Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2018

    Default How Do I Keep and Discard Individual Lines When Doing Three-Way Merge

    I am using Git as my source control system. I use SourceTree as a GUI to help with this. SourceTree allows external diff tools to be launched when there is a merge conflict. I have configured it to use Beyond Compare 4 and this launches fine, with the correct three versions of the file displayed in the three panes at the stop of the screen.

    My question is a very simple one and I can't help but feel it must have been answered already but I can't find it.

    How do I have line-by-line control over which lines I take and discard from the left and right files?

    I can resort to full edit but doing this, I end up literally retyping the lines displayed above because I can't figure out how to copy a line from the panes above.

    Related to the above question is the problem of alignment. If I keep a line from the left file and then one from the right file, clearly my target files in the lower pane now has an extra line to the files I started with. is there a way to 'line-up' the compare again?

    Any help or pointers to information would be very much appreciated.

    Kind wishes ~ Patrick

  2. #2
    Join Date
    Oct 2007
    Madison, WI



    A few quick methods:

    1) click into the gutter to select a single line in one of the top input panes, and the gutter selection for a single pane then copies just the one (or multiple) lines.

    2) Session menu -> Session Settings, Alignment tab: A merge conflict is Left change and right change separated by lines, which will link between Conflict sections, but can be reduced to 1 or "only different change lines"

    3) Tools menu -> File Formats, and select/edit or new Text format, and under the Misc tab you can set "Lines as Independent" so every line is individually handled.

    With the Take Left then Right command, it will attempt to auto-align, but you can also right click -> Align With on one line, and then select a target line to manually push the alignment around.

    Do any of these methods work best for you?
    Aaron P Scooter Software

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts