4 回答

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

TA貢獻1876條經驗 獲得超7個贊
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 關注
- 923 瀏覽
添加回答
舉報