tags:

views:

523

answers:

4

Hi,

Is it possible to configure git diff to use emacs diff? If yes, can you please tell me how?

Thank you.

+4  A: 

See this question: how-do-i-view-git-diff-output-with-visual-diff-program for information on git difftool.

You can also use git from within emacs: EmacsWiki: Git.

Karl Voigtland
The question linked here goes through a nice explanation of arguments passed to the external differ, which I left up to the man pages in my answer.
Jefromi
+2  A: 

It seems to be possible, according to the Pro Git book.

See chapter 7.1 for more information, but the quick'n'dirty of it seems to be

$ git config --global diff.external [your favorite differ here]

or, if you want it to your ~/.gitconfig

[diff]
  external = [your favorite differ here]
Henrik Paul
+1  A: 

Assuming you mean git-diff, not git-difftool, you are probably looking for the diff.external config option. You'll want to look at the git Diffs section of git(1). This section doesn't mention the config setting, though it's listed in git-config(1).

Jefromi
+2  A: 

If you are working within Emacs, you could advice vc-git-diff (the function is found in vc-git.el for reference), to give you the option of using either git-diff or emacs-diff according to your whim (and it wouldn't require you "forking" the git library that comes bundled with Emacs).

Pinochle