4

My git global config C:\Users\.gitconfig looks like:

[diff]
tool = bc3

[difftool "bc3"]
path = C:/Program Files (x86)/Beyond Compare 3/BCompare.exe
cmd = \"C:/Program Files (x86)/Beyond Compare 3/BCompare.exe\" \"$LOCAL\" \"$REMOTE\"

I am using Windows 7 x64 OS. I have Beyond Compare Pro 3.3.5 version.

I want to pass one or more arguments when calling BCompare.exe I tried this, but it doesn't work:

cmd = \"C:/Program Files (x86)/Beyond Compare 3/BCompare.exe\ /expandall" \"$LOCAL\" \"$REMOTE\"

git difftool --dir-diff dev master

I want to do a directory compare between a dev and master branches and to expand all folders within Beyond Compare tool. This should do the same as a corresponding button in Beyond Compare GUI: Expand All which expands all folders in left and right pane.

I need to possibly pass 2 arguments: /solo /expandall

Thanks, Rad

3
  • 1
    Have you already checked this page? scootersoftware.com/support.php?zz=kb_vcs#gitwindows
    – 1615903
    Commented Apr 8, 2013 at 10:14
  • Yes. It doesn't talk about incorporating switches. My compares work, but I would like some extra functionality that switches provide.
    – Rad
    Commented Apr 10, 2013 at 17:41
  • FYI ignore file structure might do better as default behaviour in bc as opposed to expand all - it allows jumping between files using ctrl-m and ctrl-shift-m, while not being constrained by a single folder
    – bushed
    Commented Feb 9, 2014 at 10:28

1 Answer 1

13

Use the form -expandall instead of /expandall, and note that -solo is required (explanation below).

[diff]
    tool = bc3
[difftool "bc3"]
    cmd = \"E:/PortApps/Beyond Compare 3/bcomp.exe\" -expandall -solo \"$LOCAL\" \"$REMOTE\"

The above works for me with Beyond Compare 3.3.8 (Standard Edition) and Git For Windows 1.8.4 (msysgit), on Windows XP SP3 (x86 32-bit).

Notes

  1. I found the path setting wasn't necessary if I provided cmd.

  2. You may need to use BCompare.exe instead of bcomp.exe, according to BC tech support ... but I found it worked fine either way.

Solo explained

The -solo option makes the comparison open in a new window. difftool will then wait for you to close it before deleting the temp files being compared.

Without this option, if you already have a Beyond Compare window open, the comparison will appear in a new tab there. This seems convenient but won't actually work, because difftool will have immediately deleted the files to be compared, since your invocation of bcomp.exe merely delegated the task to the already-running app and then exited.

1
  • Great that worked. Thanks. I am using VS 2013 with Git support and I can copy CommitID and copy it to my powershell posh-git and compare like this: git difftool --dir-diff master 173dc827230751ef2cf0dcaae8229722506968ba or git difftool --dir-diff dev master
    – Rad
    Commented Dec 17, 2013 at 8:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.