1.首先確保本地提交已完成
2.查看需要合併 的提交內容
git log --pretty=oneline
3.合併提交
git rebase -i HEAD~3 #合併最近三次的提交
4.如果出現:
則先處理文件衝突, 再次提交, 然後執行:(如果沒有出現衝突,則執行第5步)
git add -A -m"fix conflict"
git push
git rebase --continue
5.修改合併的提交信息
6.修改結束之後繼續執行: git rebase --continue
如果git push出現錯誤:
執行如下語句即可:
git push -f #強制推送覆蓋以前的commit
rebase options: