產生原因:
git pull 的時候會分為兩步,第一步先從遠程服務器上拉下代碼,第二步進行merge。當你merge時候失敗了就會產生Automatic merge failed; fix conflicts and then commit the result.的問題。
解決方法:
- 丟棄本地提交,強制回到線上最新版本
git fetch --all git reset --hard origin/你需要下拉的分支(默認master) git fetch
- 保存本地提交
git reset --abort git reset --merge git commit -am '提交信息' git pull
Over.....
參考:
1、Git使用出現Automatic merge failed; fix conflicts and then commit the result.解決方法