Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Emacs Based Git Diff Tool?

Are there any emacs based visual diff tools avialable? If multiple tools are available, which is better, or more specifically which is easier to use?

How do you set up said diff tool from within git and within emacs?

Just to clarify, I will be accessing this often from outside emacs. I generally run git from the command line, and currently I am mostly developing in Visual Studio on Windows, though I do also develop in Linux (usually using emacs or Geany in that case) and Apple Mac (mainly command line and emacs).

Any major disadvantage to using emacs for diff tool if I am currently developing in Visual Studio on Windows?

Thanks.

like image 933
haziz Avatar asked Nov 20 '11 22:11

haziz


2 Answers

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
like image 58
phils Avatar answered Sep 29 '22 08:09

phils


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.

like image 31
Rémi Avatar answered Sep 29 '22 10:09

Rémi