1、场景1:同事修改了test.txt,提交到远程。我修改了test.txt,接着马上输入git pull,出现提示:
问题:
error: Your local changes to the following files would be overwritten by merge:
test.txt
Please commit your changes or stash them before you merge.
Aborting
Updating b20f778..d0daa36
1) git stash # 封存修改
2) git pull origin master
3) git pull origin master # 把修改还原
这时,test.txt会变成上下两行的情况,类似:
<<<<<<<<<<
11111
>>>>>>>>
22222
修改成你自己想要的,比如只保留22222,然后git add, git commit, push即可。
2、场景2:同事修改了test.txt,提交到远程。我也修改了test.txt,提交到本地后,再使用push,提示如下,继续pull提示冲突
会变成(dev|MERGING),修改test.txt,提示:
接着再add, commit, push origin就可以了。
标签:pull,git,修改,不同,merge,test,情况,txt From: https://www.cnblogs.com/ysgd/p/17371141.html