$ 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

 

posted on 2016-06-22 22:28  jzfan  阅读(227)  评论(0编辑  收藏  举报