在使用git pull 代码时,经常会遇到冲突,如下:
error: Your local changes to the following files would be overwritten by merge:
dpcm/src/struts.xml
Please, commit your changes or stash them before you can merge.
遇到这个种情况下,可以通过以下步骤来解决
第一: 先将本地与服务器冲突的文件存储起来。
$ git stash
第二:使用pull 命令,把服务器更新到本地
$ git pull
第三:还原暂存本地的内容
$ git stash pop stash{0}
第四: 在本地冲突的文件中,找到带有标记(>>>>> stashed changes)的地方,根据情况自己解决