4 回答

TA貢獻(xiàn)1963條經(jīng)驗(yàn) 獲得超6個(gè)贊
修改最近的提交消息
git commit --amend
git commit --amend -m "New commit message"
更改已推送到遠(yuǎn)程分支的提交消息
git push <remote> <branch> --force# Orgit push <remote> <branch> -f
警告:強(qiáng)制推送將用本地分支的狀態(tài)覆蓋遠(yuǎn)程分支。
警告:在修改你已經(jīng)和其他人分享過的承諾時(shí)要小心。
使用交互式重基
// X is the number of commits to the last commit you want to be able to edit git rebase -i HEAD~X
e/r
關(guān)于交互式重基的重要注記
git rebase -i HEAD~X
X
X
好消息:
git rerere
文獻(xiàn)資料

TA貢獻(xiàn)1876條經(jīng)驗(yàn) 獲得超7個(gè)贊
git commit --amend
git commit --amend -C HEAD
git reset --hard HEAD^
git rebase -i HEAD~commit_count
git commit --amend git rebase --continue
git commit --amend
- 4 回答
- 0 關(guān)注
- 913 瀏覽
添加回答
舉報(bào)