fatal --You are in the middle of a merge -- cannot amend 如何解決


在本地分支
1、git stash 將修改的文件保存下來

2、git reset --merge 取消合並

3、git rebase 重新定位到和追蹤分支相同的基准。

如果 3 有沖突
1)解決沖突 
2)git add + 文件
3)git rebase (--continue) 

4、git stash pop 將保存文件彈出

如果4 有沖突
1)解決沖突
2)git add + 文件

5、git commit --amend

6、git push -f


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM