gitgit-mergebeyondcompare3

Move running merge of git to beyond compare


I made certain changes in my local branch. I didn't commit. I just indexed all changes and moved them to stash. Now I did a

git pull

After git pull I did

git stash apply

Now there are some conflicts. In eclipse I am able to see the conflicts in normal git format

<<<< Updated Upstream
ksldjflsdk
sdlkfjdslk
sdlkfjsdlk
===========
sdlkfjdslk
dslkfjdslkfj
dsklfjsdlkjf
>>>>> Stashed Changes

Now there are some files with hell lot of conflicts. It is very difficult for me to look up and down and merge. Is there a way I can move current merge process to beyond compare.

I am on git version 1.8.3 and Beyond Compare 3.2.3


Solution

  • I'm assuming that you're okay with launching Beyond Compare from the command line, and that you're on Windows. You can add the following lines to your global .gitconfig file:

    [merge]
        tool = bc3
    [diff]
        tool = bc3
    [difftool "bc3"]
        cmd = "\"c:/program files (x86)/beyond compare 3/bcomp.exe\" \"$LOCAL\" \"$REMOTE\""
    [mergetool "bc3"]
        cmd = "\"c:/program files (x86)/beyond compare 3/bcomp.exe\" \"$LOCAL\" \"$REMOTE\" \"$BASE\" \"$MERGED\""
    

    Edit: Adding Mac commands straight from site:

    git config --global diff.tool bc3
    git config --global merge.tool bc3
    git config --global mergetool.bc3.trustExitCode true
    

    Then you can simply start conflict resolution with the following commands:

    git mergetool # Starts Beyond Compare for all conflicted files, one at a time.
    git mergetool -- <file> # Starts B.C. just for the specified file.