码迷,mamicode.com
首页 > 其他好文 > 详细

git 解决冲突

时间:2016-06-22 23:19:51      阅读:135      评论:0      收藏:0      [点我收藏+]

标签:

$ 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

 

git 解决冲突

标签:

原文地址:http://www.cnblogs.com/fenle/p/5608846.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!