1. 程式人生 > >git使用常見錯誤及修復

git使用常見錯誤及修復

1 2 3 4 $ git pull -f Updating 0260748..56d98c2 error: Your local changes to the following files would be overwritten by merge:

此時如果需要保留本地修改,則git stash暫存本地修改,然後git pull,拉下來,再git stash pop 。  最後使用git diff比較檔案的merge情況

如果放棄本地的所有修改, 完全使用版本庫中的檔案,則使用

git reset --HEAD

然後git pull拉取程式碼即可