3

I know that the latest git can use this command to directory diff two versions:

git difftool -d <sha1> <sha1>

But I can't find any git clients(GUI) which can do this job.

I've tried tortoisegit smartgit git-cola git-extentions github gitk

None of them has this feature, could anyone recommend any git client(runs on windows xp) which can do this?

I don't know if sourcetree can do this or not, cause I don't have either win7 or mac.

Thanks.

shengy
  • 9,461
  • 4
  • 37
  • 61
  • 1
    You don’t know what to set as difftool? – Chronial Mar 29 '13 at 15:29
  • I know how to set a difftool, and I also know how to directory diff two revisions via command line, I just don't know what git client (GUI) can do this simply by selecting two revisions and click some "directory diff these two revisions" – shengy Mar 31 '13 at 12:57

4 Answers4

1

The standard windows git client, msysgit, can do this if you configure it to use Beyond Compare 3 (not free) as diff tool.

You can set it up like this:

git config --global diff.tool bc3
git config --global difftool.bc3.cmd "\"c:/Program Files/Beyond Compare 3/BCompare.exe\" \"$LOCAL\" \"$REMOTE\""
git config --global difftool.prompt false

Edit: Actually kdiff3 does this too, and is free. Setup here:

[diff]
    tool = kdiff3

[merge]
    tool = kdiff3

[mergetool "kdiff3"]
    path = C:/YourPathToBinaryHere/KDiff3/kdiff3.exe
    keepBackup = false
    trustExitCode = false

[difftool "kdiff3"]
    path = C:/YourPathToBinaryHere/KDiff3/kdiff3.exe
    keepBackup = false
    trustExitCode = false
Klas Mellbourn
  • 42,571
  • 24
  • 140
  • 158
  • 1
    I know how to do this through a command line, but what I want is a GUI which can simply select two revisions and click a `directory diff these two versions` or something like that. Not entering the `git difftool -d rev1 rev2` – shengy Mar 31 '13 at 12:35
1

in tortoise git:

  • open "git log"
  • mark two commits
  • rightclick
  • compare these revisions
wutzebaer
  • 14,365
  • 19
  • 99
  • 170
  • Hold down shift before and during right clicking for "Show Reflog". This lets you compare local and remote versions. I use it to see what exactly my branch is trying to do for example. – Dirk Bester Jan 30 '15 at 04:11
0

In SmartGit/Hg you can configure external file compare tools: go to Edit|Preferences and configure them at Tools - File Comparators.

You can diff two commits from within the Log: just select both of them in the Graph view (Control-click on Windows) and you will see all changes in the Files view. Here you can investigate individual files with your external compare tool simply by double-clicking.

mstrap
  • 16,808
  • 10
  • 56
  • 86
  • But how to do a directory diff? not viewing a diff of single files each time. – shengy Mar 31 '13 at 12:35
  • Why would you like to do that in an external tool? A Git client will do the directory diff more efficiently. – mstrap Mar 31 '13 at 17:56
  • Because you can't persuade all your colleges to us the command line interface, and that feature is what they get used to because of `tortoisehg` – shengy Apr 01 '13 at 13:34
  • @shengy Maybe I misunderstood your goal -- I've added more information to my answer. – mstrap Apr 02 '13 at 10:47
  • Thats not my goal either:), you can update your git to the latest version and setup a difftool like `beyond compare` or `kdiff3` or `meld` and then use the command `git difftool -d rev1 rev2` and see the effects, my goal is to finish this job in a GUI by a few clicks without involving any command line input. – shengy Apr 03 '13 at 01:58
  • I see now. There is no such option to do that with SmartGit/Hg. SmartGit/Hg has its own built-in "Files" area which is more or less a directory diff view. – mstrap Apr 03 '13 at 15:14
0

Simply use gitk. Right click on a commit -> mark this commit. Right click on another commit -> diff this -> marked commit.

Chronial
  • 66,706
  • 14
  • 93
  • 99
  • This also does not do a directory diff, I can only view single files in my difftool once a time by right clicking the file and select `external diff` – shengy Apr 03 '13 at 01:56
  • where did I say anything about an external diff? Gitk itself will diff all the files in your worktree. – Chronial Apr 03 '13 at 11:10
  • I know the work is done by git, but the real thing is my colleges are used to see the side-by-side diff, not the united diff. – shengy Apr 03 '13 at 14:31