Merge conflict resolution

后端 未结 5 1571
执笔经年
执笔经年 2021-01-31 07:35

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?
5条回答
  •  南方客
    南方客 (楼主)
    2021-01-31 08:03

    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…

    Kaleidoscope's Integration menu option.

    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.

    Kaleidoscope's Git Integration dialog.

    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.

    Kaleidoscope sane view for merge conflicts.

提交回复
热议问题