3

When I view a git commit history in git gui, is there a way to use an external diff tool to show commit differences?

seticer
  • 139
  • 1
  • 9

1 Answers1

5

Sure, git difftool. For example:

git difftool -t gvimdiff master^..master

If you're talking about git-gui - it uses gitk internally for viewing history. You can configure an external diff tool using Edit->Preferences. It's a little tricky to see where it's used: When viewing a difference normally (either by selecting a commit or using the various "Diff this -> selected" options), using "Patch" view on the right-hand panel, right-click a file and select "External Diff". This will use the diff tool you configured.

lutzky
  • 598
  • 5
  • 12
  • And do not forget you can configure Git to use a particular diff tool by default through several `git config` commands. See **[here](http://git-scm.com/docs/git-difftool.html)** for information on the configuration variables to set. – miqh Dec 16 '13 at 06:16
  • I was asking about integrating git gui with external diff tool. – seticer Dec 16 '13 at 06:36
  • @seticer, I've extended the answer to explain for `git-gui`. I hope that's what you meant. – lutzky Dec 16 '13 at 17:49
  • i.e. it's impossible to replace this diff http://nathanj.github.io/gitguide/images/11.png with external diff? – seticer Dec 17 '13 at 04:10
  • I It isn't possible, probably because of the stage/unstage actions, as shown in your screenshot. There are alternative git GUI tools though. – lutzky Dec 17 '13 at 05:06
  • +1000 for "right-click a file and select external diff" - a very unintuitive design - thanks for pointing this out – Andy May 09 '18 at 08:46