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