How to interactively (visually) resolve conflicts in SourceTree / git

前端 未结 3 541
礼貌的吻别
礼貌的吻别 2020-12-22 17:41

I\'m using (Windows) SourceTree for my git project. I can do it in either command prompt or Linux terminal.

But, I\'m wondering whether there is a nice way to intera

相关标签:
3条回答
  • 2020-12-22 17:57

    When the Resolve Conflicts->Content Menu are disabled, one may be on the Pending files list. We need to select the Conflicted files option from the drop down (top)

    hope it helps

    0 讨论(0)
  • 2020-12-22 18:09

    I'm using SourceTree along with TortoiseMerge/Diff, which is very easy and convinient diff/merge tool.

    If you'd like to use it as well, then:

    1. Get standalone version of TortoiseMerge/Diff (quite old, since it doesn't ship standalone since version 1.6.7 of TortosieSVN, that is since July 2011). Links and details in this answer.

    2. Unzip TortoiseIDiff.exe and TortoiseMerge.exe to any folder (c:\Program Files (x86)\Atlassian\SourceTree\extras\ in my case).

    3. In SourceTree open Tools > Options > Diff > External Diff / Merge. Select TortoiseMerge in both dropdown lists.

    4. Hit OK and point SourceTree to your location of TortoiseIDiff.exe and TortoiseMerge.exe.

    After that, you can select Resolve Conflicts > Launch External Merge Tool from context menu on each conflicted file in your local repository. This will open up TortoiseMerge, where you can easily deal with all the conflicts, you have. Once finished, simply close TortoiseMerge (you don't even need to save changes, this will probably be done automatically) and after few seconds SourceTree should handle that gracefully.

    The only problem is, that it automatically creates backup copy, even though proper option is unchecked.

    0 讨论(0)
  • 2020-12-22 18:11

    From SourceTree, click on Tools->Options. Then on the "General" tab, make sure to check the box to allow SourceTree to modify your Git config files.

    Then switch to the "Diff" tab. On the lower half, use the drop down to select the external program you want to use to do the diffs and merging. I've installed KDiff3 and like it well enough. When you're done, click OK.

    Now when there is a merge, you can go under Actions->Resolve Conflicts->Launch External Merge Tool.

    0 讨论(0)
提交回复
热议问题