今天在服務器上git pull是出現以下錯誤:
error: Your local changes to the following files would be overwritten by merge:
application/config/config.php
application/controllers/home.php
Please, commit your changes or stash them before you can merge.
Aborting
不知道什么原因造成的代碼沖突,處理方法如下:
如果希望保留生產服務器上所做的改動,僅僅并入新配置項:
git stash
git pull
git stash pop
然后可以使用git diff -w +文件名 來確認代碼自動合并的情況.
如果希望用代碼庫中的文件完全覆蓋本地工作版本. 方法如下:
git reset --hard
git pull
轉載于:https://www.cnblogs.com/seven7seven/p/5238836.html