Automatic merge failed; fix conflicts and then commit the result.解決方法


產生原因:

git pull 的時候會分為兩步,第一步先從遠程服務器上拉下代碼,第二步進行merge。當你merge時候失敗了就會產生Automatic merge failed; fix conflicts and then commit the result.的問題。

解決方法:

    1. 丟棄本地提交,強制回到線上最新版本
      git fetch --all
      git reset --hard origin/你需要下拉的分支(默認master)
      git fetch
    2. 保存本地提交
      git reset --abort
      git reset --merge
      git commit -am '提交信息'
      git pull

        

 

 

Over.....

 

參考:

1、Git使用出現Automatic merge failed; fix conflicts and then commit the result.解決方法

 


免責聲明!

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



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