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