Emacs Based Git Diff Tool?

ediff is a visual diff tool built into Emacs.

It depends on the external diff tools of course, so Windows users need to ensure they have those available: How can I use ediff under Windows + NTEmacs?

There are lots of built-in ediff functions, so you can take a look at the auto-completions for M-x ediff TAB to get a quick idea of some of the functionality available, and then read the manual in the info pages:

M-: (info "(ediff) Top") RET

Useful pages on the Emacs Wiki:

  • http://www.emacswiki.org/emacs/EdiffMode
  • http://www.emacswiki.org/emacs/EdiffTrees

If you want to use git with Emacs you have several tools:

  • magit
  • egg
  • look at Emacs Wiki for more

I use magit, its status mode will list the modified files, and you can use TAB to show the difference between worktree and index, or between index and HEAD.

It can also call git diff for viewing diff between different version of the worktree (key d or D).

It will also be able to use ediff to merge unmerged files, and much more.