# Thread: git difftool load all files into a folder compare view

1. New User
Join Date
Apr 2011
Posts
1

## git difftool load all files into a folder compare view

Hey,

I've recently migrated from TortoiseHg/BeyondCompare to GIT/BeyondCompare. When I was comparing commit revisions in Hg, it would load all of the differences into the folder compare view - from there I could double click any file to see its differences.

I have successfully setup git to use BC3 as both difftool and mergetool. However, when I run 'git difftool' it loads each of the files sequentially as textcompare in bc3 and waits for me to close each file before loading the next one.

I have found a solution which enables loading of all the files simultaneously, however, they are still loaded as tabbed text compares with no folder compare tree for me to look at. http://blog.codefarm.co.nz/2009/08/g...all-files.html

Does anyone know how I can load my diffs into a folder view?
Thanks,

2. Enthusiast
Join Date
May 2005
Location
Germany
Posts
43

similar to my question from Januar:

I have found a solution which enables loading of all the files simultaneously
Thanks for the hint, it may be usefull for me.

3. Team Scooter
Join Date
Oct 2007
Location
Posts
11,890
I'm not aware of a method for git to compare revisions as Folders. If there are any users who know of a method, please let us know.

One thing that may be useful is to perform an export of a revision to make a local copy of the repository you want to compare your local files to.
http://stackoverflow.com/questions/1...ike-svn-export

4. Visitor
Join Date
Jul 2017
Posts
5
Originally Posted by thegoatherder
Hey,

I've recently migrated from TortoiseHg/BeyondCompare to GIT/BeyondCompare. When I was comparing commit revisions in Hg, it would load all of the differences into the folder compare view - from there I could double click any file to see its differences.

I have successfully setup git to use BC3 as both difftool and mergetool. However, when I run 'git difftool' it loads each of the files sequentially as textcompare in bc3 and waits for me to close each file before loading the next one.

I have found a solution which enables loading of all the files simultaneously, however, they are still loaded as tabbed text compares with no folder compare tree for me to look at. http://blog.codefarm.co.nz/2009/08/g...all-files.html

Does anyone know how I can load my diffs into a folder view?
Thanks,
Hello

I know it's been 6 years since this post, but I really need exactly this and the link is broken. How did you solve this?

Thanks!

5. Team Scooter
Join Date
Oct 2007
Location
Posts
11,890
Hello,

The key you are looking for is Git's -dir-diff support:
https://git-scm.com/docs/git-difftool

Define the difftool as BC, and then add an alias to use --dir-diff --no-symlinks (or just --dir-diff and after launching using the Session Setting: Follow Symbolic Links)

6. Visitor
Join Date
Jul 2017
Posts
5
Originally Posted by Aaron
Hello,
Define the difftool as BC, and then add an alias to use --dir-diff --no-symlinks (or just --dir-diff and after launching using the Session Setting: Follow Symbolic Links)
Thanks! that helped!

I just have another question. I noticed that when BC opens, the changes on the working copy are in the "Right" side. Also, the path to the working copy file that appears in the BC "path" field is not the exact path for such file and therefore if I modify something it is not reflected in the actual file.

Do you know how can I:

1. Open BC with my working copy file in the "Left" side?
2. point to the real working copy file path so I'm able to make changes right in BC?

Thanks!

7. Team Scooter
Join Date
Oct 2007
Location
Posts
11,890
BC4's command line expects parameters:
bcompare.exe "c:\left" "c:\right"

How have you currently defined your .gitconfig?
http://www.scootersoftware.com/suppo...vcs#gitwindows

Git does manage the directories and order automatically, but you could override this by providing more parameter detail.

As for edits not coming through: if you remove --no-symlinks and instead enable the BC3 option in the Folder Compare's Session menu -> Session Settings -> Handling tab: Follow Symbolic Links, does this show the comparison correctly and allow the editing you need?

8. Visitor
Join Date
Jul 2017
Posts
5
Originally Posted by Aaron
As for edits not coming through: if you remove --no-symlinks and instead enable the BC3 option in the Folder Compare's Session menu -> Session Settings -> Handling tab: Follow Symbolic Links, does this show the comparison correctly and allow the editing you need?
Thanks

The symlinks suggestion worked perfectly. Now if I modify something in BC it gets reflected in the code. So that's solved.

The thing I haven't been able to figure out is the order. You say that:
Originally Posted by Aaron
BC4's command line expects parameters:
bcompare.exe "c:\left" "c:\right"

How have you currently defined your .gitconfig?
http://www.scootersoftware.com/suppo...vcs#gitwindows

Git does manage the directories and order automatically, but you could override this by providing more parameter detail.
This is my .gitconfigure contents

[diff]
tool = bc3
[difftool "bc3"]
trustExitCode = true
[merge]
tool = bc3
[mergetool "bc3"]
trustExitcode = true
[alias]
dif= difftool --dir-diff

So my question is, what parameters should I specify to override the git directories order and more importantly, how do I specify those parameters?

Bcause I don't see how I can specify them in the .gitconfig.

Thanks again! You are being really helpful!

9. Team Scooter
Join Date
Oct 2007
Location
Posts
11,890
Hello,

Git has built-in support for using "bc" or "bc3" keywords, which then handles the parameters and everything else automatically. It's the method we recommend using. After load, you can always use the Swap button in the toolbar to flip the view of Left <-> Right

However, if you further define "cmd" you can pass in the path to the program and parameter list, making a more manual definition of what should be used. GitHub's definition is like this:
http://www.scootersoftware.com/suppo...#githubwindows

From Beyond Compare's perspective, our command line is bcompare.exe "left" "right" "base" "merged", so you would need to flip the appropriate variables to fit the view you need. If you are overriding /titles, please be careful to properly match the correct title to the correct variable, or the title might mismatch the data below it.

10. Visitor
Join Date
Jul 2017
Posts
5
Aaron

Thanks for helping. Finally, I have the results I need!

For reference and in case somebody else lands in this thread and is looking for this solution, I will add my results here.

This is for opening BC to compare differences between your working copy and the last commit.

BC will open the working copy files on the left and the right files will be read only, thus not allowing any changes on the right-side files. Additionally, any changes made in BC editor will be made in the actual working copy files, thus allowing you to "revert" any changes individually by clicking the "Copy to Left" yellow arrow.

----------------------------------------------------------------------------------------
[diff]
tool = bc3
[difftool "bc3"]
cmd = bcompare -rro "$REMOTE" "$LOCAL"
trustExitCode = true
[alias]
dif= difftool --dir-diff
----------------------------------------------------------------------------------------

With that contents in the .gitconfig file, then you just execute

\$ git dif

And BC will open as described above.