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即可。