If some of the configuration files on the system have been modified on the server, and then the subsequent development adds some new configuration items,
A code conflict occurs when this configuration file is published:
Error:your local changes to the following files would is overwritten by merge:
protected/config/main.php
Please, commit your changes or stash them before you can merge.
If you want to keep the changes made on the production server, just incorporate the new configuration items, and the process is as follows:
git stash
git pull
git stash pop
You can then use git diff-w + filenames to confirm the automatic merging of your code.
Conversely, if you want to completely overwrite the local working version with a file in the code base. Here's how:
git reset --hard
git pull
Where git reset is for the version, if you want to modify the file fallback locally, use the
git checkout HEAD File/to/restore
Transferred from: http://blog.csdn.net/iefreer/article/details/7679631
Please, commit your changes or stash them before you can merge.