首页 > 其他 > 详细

Git代码冲突解决办法

时间:2015-02-27 00:17:13      阅读:355      评论:0      收藏:0      [点我收藏+]

命令行git pull产生冲突后,手工编辑冲突文件并保存,之后再执行git add -u命令添加变化的文件,再commit并push即可。具体参考如下文章

http://stackoverflow.com/questions/12192649/git-help-userinterfacestate-xcuserstate-warning-merge-conflict-file-still-mar

When there is a merge conflict, you MUST resolve it first. (well maybe you can run git merge --abort to revert).

So the process is you open your conflicting file, you look for the conflict, resolve it (edit the conflicting lines), then save your file, add it (using git add -u) and commit it.

Then you can work on a clean work directory.

By the way, a conflict probably looks like:

<<<<<<< yours:sample.txt Conflict resolution is hard;

let‘s go shopping.

Git makes conflict resolution easy.

theirs:sample.txt reference: http://www.kernel.org/pub/software/scm/git/docs/git-merge.html

Git代码冲突解决办法

原文:http://www.cnblogs.com/wolfcamel/p/4302408.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!