Magit

Magit is an interface to the version control system Git, implemented as an Emacs package. Magit aspires to be a complete Git porcelain. While we cannot (yet) claim that Magit wraps and improves upon each and every Git command, it is complete enough to allow even experienced Git users to perform almost all of their daily version control tasks directly from within Emacs. While many fine Git clients exist, only Magit and Git itself deserve to be called porcelains. (more)

Crash course

Getting started with Magit is really easy:

Other handy keys:

You might also want to read the official Getting-started guide.

Screencasts

Extensions

Various packages exist which extend Magit, including:

You can find even more extensions by searching for “magit” on https://melpa.org. You might also want to search for “git”.

Diff worktree with commit at point

The code below introduces a way to invoke `magit-diff` from any magit buffer with the commit at point as its only argument. This produces a diff with the worktree.

(defun my-magit-diff-with-commit-at-point ()
  (interactive)
  (let* ((section (magit-current-section))
         (value (oref section value)))
    (magit-diff-range (magit-rev-parse value))))

(transient-append-suffix `magit-diff "r"
  '("W" "Diff worktree at point" my-magit-diff-with-commit-at-point))

Git CategoryVersionControl