git 解决冲突

$ git push origin master
To /home/fan/repo/code/../a.git/
 ! [rejected]        master -> master (fetch first)

push失败,版本落后,提示要fetch

$  git fetch origin 

$  git  merge origin/master
Auto-merging a.txt
CONFLICT (content): Merge conflict in a.txt

发生冲突

选择修改,解决冲突

git checkout --ours  a.txt //放弃自己的

git checkout --theirs a.txt  //放弃别人的

提交处理后的文件,再push

git add a.txt

git commit -m 'fix conflicts'

git push origin master:master
原文地址:https://www.cnblogs.com/fenle/p/5608846.html