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

Git使用出現Automatic merge failed; fix conflicts and then commit the result.解決方法
產生原因
首先這個問題產生的原因是因爲你git pull 的時候會分爲兩步,第一步先從遠程服務器上拉下代碼,第二步進行merge,但是merge時候失敗了就會產生上述問題。

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

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章