git pull
error:
SHOW
Your local changes to the following files would be overwritten by merge
error: Your local changes to the following files would be overwritten by merge:
protected/config/main.php
Please, commit your changes or stash them before you can merge.
SOLUTION
如果希望保留生產伺服器上所做的改動,僅僅併入新配置項, 處理方法如下:
git stash
git pull
git stash pop
然後可以使用git diff -w +檔名 來確認程式碼自動合併的情況.
反過來,如果希望用程式碼庫中的檔案完全覆蓋本地工作版本. 方法如下:
git reset --hard
git pull
其中git reset是針對版本,如果想針對檔案回退本地修改,使用