git错误解决: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.

解决方法:
希望保留产服务器所做改,仅仅并入新配置项, 处理:
git stash
git pull
git stash pop

使用Git diff -w +文件名 确认代码自合并情况.

反,希望用代码库文件完全覆盖本工作版本. :

git reset --hard
git pull
————————————————
版权声明:本文为CSDN博主「南无南有」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/qq_39416311/article/details/88698976

posted @ 2021-07-23 16:12  星云惊蛰  阅读(0)  评论(0)    收藏  举报