1. 程式人生 > >Git pull 或 merge遇到的一些問題

Git pull 或 merge遇到的一些問題

在Git pull或merge的時候總是遇到類似下面的錯誤:

Git Pull Failed

error: You have not concluded your merge (MERGE_HEAD exists).
fatal: Exiting because of unfinished merge.

Git Merge Failed

fatal: You have not concluded your merge (MERGE_HEAD exists).

Git Pull Failed
Your local changes would be overwritten by merge.
Commit, stash or revert them to proceed. View them

解決方案是

1. 需要先commit。在Android studio的VCS--- Commit Changes 或者terminal 輸入下面的指令:git commit -m "commit info"  。之後再pull或merge就可以順利進行。

2.放棄本地修改,直接覆蓋之

git reset --hardgit pull