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

转载于:https://www.cnblogs.com/wolfcamel/p/4302408.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值