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

你可能感兴趣的:(工具)