1. 程式人生 > 其它 >git pull 強制_git問題總結

git pull 強制_git問題總結

技術標籤:git pull 強制

問題一點點累積

GIT 中提示 please tell me who you are

如果使用git過程中出現了,please tell me who you are

8a302747996750fd84a7d4b7a1c23c03.png

需要設定一下使用者的身份

1.git config user.name "username"2.git config user.email "[email protected]"

You have not concluded your merge. (MERGE_HEAD exists)

Git本地有修改如何強制更新

本地有修改和提交,如何強制用遠端的庫更新更新。我嘗試過用git pull -f,總是提示 You have not concluded your merge. (MERGE_HEAD exists)。

我需要放棄本地的修改,用遠端的庫的內容就可以,應該如何做?傻傻地辦法就是用心的目錄重新clone一個,正確的做法是什麼?

正確的做法應該是:

git fetch --allgit reset --hard origin/master

git fetch 只是下載遠端的庫的內容,不做任何的合併git reset 把HEAD指向剛剛下載的最新的版本

參考連結:

http://stackoverflow.com/questions/1125968/force-git-to-overwrite-local-files-on-pull