Git代码冲突解决办法

命令行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

posted @ 2015-02-26 23:28  wolfcamel  阅读(333)  评论(0编辑  收藏  举报