Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2018
    Posts
    6

    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
    Location
    Madison, WI
    Posts
    11,830

    Default

    Hello,

    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

  3. #3
    Join Date
    Mar 2018
    Posts
    6

    Default

    Quote Originally Posted by Aaron View Post
    Hello,

    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?
    Method #1 seems easiest. I'm being a bit thick with the manual alignment, though. Don't seem to be able to get it to do what I want it to do. I think I am probably just not reading the differences display properly.

    Thank you for your help.

  4. #4
    Join Date
    Oct 2007
    Location
    Madison, WI
    Posts
    11,830

    Default

    The manual alignment command in the Text Merge works by selecting a single line in an input (top) pane, right-click -> Align With, and then clicking on a specific line in another input pane. This then aligns that pairing instead of the default/algorithm's alignment, which alters the bottom Output pane.
    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
  •