c2tarun
c2tarun

Reputation: 795

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

Upvotes: 14

Views: 11867

Answers (2)

hello_earth
hello_earth

Reputation: 1562

just an update based on the previous answer whose user seems to be inactive - please upvote the other post - for Beyond Compare 4 that would be (the only difference is the default directory with 4 instead of 3 in it and bcomp.exe turning into bcompare.exe) [Edit: global .gitconfig on Windows machines is usually in user's home directory, i.e. ~ in Git Bash or something like C:\Users\YourUserName]

[merge]
    tool = bcompare
[diff]
    tool = bcompare
[difftool "bcompare"]
    cmd = "\"c:/program files/beyond compare 4/bcompare.exe\" \"$LOCAL\" \"$REMOTE\""
[mergetool "bcompare"]
    cmd = "\"c:/program files/beyond compare 4/bcompare.exe\" \"$LOCAL\" \"$REMOTE\" \"$BASE\" \"$MERGED\""

Also git mergetool seems to generate backup files with the .orig ending - BC does not have to do something with it. Here there is a suggestion to just delete these files afterwards and leave the global git settings alone (syntax is for Git Bash):

find . -name *.orig -delete

Upvotes: 4

user456814
user456814

Reputation:

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.

Upvotes: 24

Related Questions