I would like to know if there is a way to get the standard side by side diff view in magit. That is, instead of seeing the old code chunk and the new one one after the other, I'd like to see them on the same horizontal alignment.

  • 3
    Although "the standard" diff view is actually what Magit shows you, you can also invoke ediff by typing e, and you can configure ediff to display side-by-side views by default.
    – phils
    Nov 18, 2016 at 10:29
  • @phils Your comment is an answer AFAICT. Hereby I encourage you to yank your comment as answer.
    – Marco Wahl
    Nov 19, 2016 at 9:22

2 Answers 2


The Emacs package for doing this is named Ediff and Magit supports Ediff. To get started press e on the change for which you want to see the side-by-side comparison. You might also have to use E occasionally to tell Ediff/Magit explicitly what you want to compare.

Also see the Ediff manual and the node about Ediff in the Magit manual.

  • However, this shows three panes, not two. 1. How to show just current and last commit? 2. How to only show changes (not all document) like in Github, for instance, where it only shows changes and some lines before and after?
    – Adelita
    Dec 1, 2022 at 11:41

Using Emacs and Magit on Windows, I didn't find it intuitive to get side by side diffs (with 2 windows instead of 3) even with the above answer. Adding this in case it helps others. Here's what I did to get it working for me.

  • Install cygwin and add the bin directory to PATH (this makes the ediff tool available to Emacs - can probably ignore this on non-Windows platforms)

  • Add the below to ~/.emacs to get 2 instead of 3 windows in the diff (ignore this if you want 3 windows)

    (setq magit-ediff-dwim-show-on-hunks t)

  • Add the below to ~/.emacs to have it default to side by side

    (custom-set-variables '(ediff-split-window-function (quote split-window-horizontally)))

  • Press E then E when over a changed file, this opens Ediff and shows a separate frame (top level Window) running Ediff, make sure that the Ediff frame has focus when entering commands

  • Press SPACE/BACKSPACE to move around through the differences (and press ? to toggle the Ediff frame between minimal and a larger size which shows all the commands)

  • Press q to exit the Ediff session and respond to the prompts back in the main Emacs frame

  • 1
    Note that Ediff has its own manual. C-h i g (ediff)
    – phils
    Sep 8, 2021 at 13:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.