Laravel 5.2--git沖突error: Your local changes to the following files would be overwritten by merge:


今天在服務器上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


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM