4

I have recently merged two branches in Git. They were both in development for too long, and hence have a lot of files that were changed on both branches, so Git has marked them as "Conflicted"

As soon as I open them in Beyond Compare, there are "no more conflicts" because its smart enough to sort out the supposed conflict. So its just a matter of open in External Merge Tool (from SourceTree) and then click Save. However, there are a lot of files that need this! Is there a way of getting Beyond Compare to "batch" process all conflicted files in my working copy?

UPDATE

My project's \.git\config file specifies the following, which I believed would force Beyond Compare 4 (Pro) to auto-merge the files, but it does not. Possibly an invalid config? I have triple checked it :(

[diff]
    tool = bc4
[difftool]
    prompt = false
[difftool "bc4"]
    path = /c/Program Files/Beyond Compare 4/BComp.exe
[merge]
    tool = bc4
[mergetool]
    prompt = false
    keepBackup = false
[mergetool "bc4"]
    cmd = /c/Program Files/Beyond Compare 4/BComp.exe -automerge -ignoreunimportant -reviewconflicts "$LOCAL" "$REMOTE" "$BASE" "$MERGED" 
    trustExitCode = true
Jimbo
  • 22,379
  • 42
  • 117
  • 159
  • I think I have more options specified in my own config file. I'll take a look when I get home. – Lasse V. Karlsen Jun 03 '17 at 08:10
  • @LasseV.Karlsen: Did you managed to find anything different? Thanks! – Jimbo Jun 05 '17 at 06:46
  • Here is my `[difftool "bc4"]`: `cmd = 'D:\\Dropbox\\Tools\\Beyond Compare 4\\BComp.exe' \"$LOCAL\" \"$REMOTE\" -lefttitle=Old/Remote/Unmodified -righttitle=New/Local/Modified -leftreadonly -closescript` and `trustExitCode = true` – Lasse V. Karlsen Jun 05 '17 at 10:48
  • 1
    Here is my `[mergetool "bc4"]`: `cmd = 'D:\\Dropbox\\Tools\\Beyond Compare 4\\BComp.exe' \"$REMOTE\" \"$LOCAL\" \"$BASE\" \"$MERGED\" -lefttitle=Remote/Theirs -righttitle=Local/Mine -centertitle=Common -outputtitle=Final -readonly -automerge -reviewconflicts -favorright -closescript` and `trustExitCode = true` – Lasse V. Karlsen Jun 05 '17 at 10:49
  • I have a batch file that sets up git from my dropbox folder, I have all my command line tools stored in there, including a portable copy of git, and here is my batch file that configures git: https://www.dropbox.com/s/p9xxdawy484xg3j/git.bat?dl=0 - Please don't download and just execute it, because it will wipe your config file and then configure it to my standards, instead look through the commands and copy the bits you think you want. – Lasse V. Karlsen Jun 05 '17 at 10:51
  • Thanks for the info, much appreciated – Jimbo Jun 05 '17 at 14:23

2 Answers2

5

If you have the pro version, you can pass bcompare the -automerge switch as shown on this page.

adzenith
  • 757
  • 5
  • 8
  • Thanks for the info. I have updated my question. Perhaps you can spot a config error of mine? Appreciated. – Jimbo Jun 02 '17 at 07:17
  • I havent. Im finding it difficult to reproduce the original situation now having resolved my existing conflicts. The time will come (soon) I'm sure :P – Jimbo Jun 05 '17 at 14:32
2

I have Beyond Compare 3 Pro, and this works for me:

[mergetool "BeyondCompare3"]
path = C:/Program Files (x86)/Beyond Compare 3/bcomp.exe
cmd = \"C:/Program Files (x86)/Beyond Compare 3/bcomp.exe\" "-automerge -ignoreunimportant -reviewconflicts" \"$LOCAL\" \"$REMOTE\" \"$BASE\" \"$MERGED\"

This will make Beyond compare auto merge, not display the GUI if successful, ignore unimportant differences such as white space. It will only pop up the GUI if a conflict is found.

user1970723
  • 282
  • 1
  • 9