合并冲突解决方案 [英] Merge conflict resolution

查看:241
本文介绍了合并冲突解决方案的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当Git发生合并冲突时,类似以下的垃圾被插入冲突的文件中。三个问题:


  1. 您如何阅读这些注释?

  2. 什么时候使用什么策略修复这些合并冲突?

  3. 是否有一个Mac的GUI工具,知道如何读取这些文件并且并排显示这两个版本,以便更容易地解决问题? / li>

解决方案

现在有一个比试图阅读Git插入到文件中的乱码标记更好的解决方案。 万花筒2 ,Black Pixel的差异化工具的第二个版本,现在也是一个合并工具。它不是免费的,但它运行的很好。



安装Kaleidoscope 2后,与Git集成非常简单。打开万花筒并从菜单栏中选择万花筒> 集成...
$ b



然后你会看到这个窗口。只需从左侧导航栏选择 Git ,然后安装 ksdiff 命令行工具,然后制作万花筒Git的默认差异和合并工具。





最后,一旦在Git中发生合并冲突,只需转到命令行并执行 git mergetool 即可。现在冲突很容易理解。享受。




When there's a merge conflict in Git, junk like the following is inserted into the conflicting files. Three questions:

  1. How do you read these annotations?
  2. What are some strategies to use when fixing these merge conflicts?
  3. Is there a GUI tool for Mac that knows how to read these files and display the two versions side-by-side to make it easier to fix the problem?

Note: In case it's relevant, I am using GitHub's Mac GUI client.

解决方案

There's now a better solution than trying to read the gibberish markers that Git inserts into your files. Kaleidoscope 2, Black Pixel's second release of their diff tool, is now also a merge tool. It's not free, but it works beautifully.

After you install Kaleidoscope 2, it's really simple to integrate with Git. Open Kaleidoscope and from the Menu Bar choose Kaleidoscope > Integration…

Then you'll see this window. Simply choose Git from the left nav and then install the ksdiff command-line tool and then make Kaleidoscope Git's default diff and merge tool.

Finally, once you have a merge conflict in Git, simply go to the command line and execute git mergetool. Now the conflict is easy to read. Enjoy.

这篇关于合并冲突解决方案的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆