1. 程式人生 > >ou have not concluded your merge (MERGE_HEAD exists)

ou have not concluded your merge (MERGE_HEAD exists)

版本 not -- ava 線上 倉庫 merge 最新版本 comm

今天獲取git線上倉庫代碼報了這個錯誤:

zhangzhi@moke:~/code/ktsg-api$ git pull
You have not concluded your merge (MERGE_HEAD exists).
Please, commit your changes before you can merge.

  

錯誤可能是因為在你以前pull下來的代碼沒有自動合並導致的.

有2個解決辦法:

1.保留你本地的修改

git merge --abort

git reset --merge

合並後記得一定要提交這個本地的合並

然後在獲取線上倉庫

git pull

2.down下線上代碼版本,拋棄本地的修改

不建議這樣做,但是如果你本地修改不大,或者自己有一份備份留存,可以直接用線上最新版本覆蓋到本地

git fetch --all

git reset --hard origin/master

git fetch

當然還有一個最笨的方法,就是重新clone一份代碼,拋棄這個工作目錄

ou have not concluded your merge (MERGE_HEAD exists)