![[Home]](https://www.emacswiki.org/images/logo218x38.png)
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)
Getting started with Magit is really easy:
M-x magit-status to see git status, and in the status buffer:s to stage filesc c to commit (type the message then C-c C-c to actually commit)b b to switch to another branchOther handy keys:
P u to do a git pushF u to do a git pullTABYou might also want to read the official Getting-started guide.
Various packages exist which extend Magit, including:
git annex within Magit git flow extension for Magitgit svn repositories {no maintainer}You can find even more extensions by searching for “magit” on https://melpa.org. You might also want to search for “git”.
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))