Reference articles on history, science, culture and more
Encyclopedia

Magit

Emacs interface for the Git version control system

Image credit is listed at the end of this article.

Magit (/ˈmædʒɪt/ MA-jit or /ˈmʌɡɪt/ MUH-git) is a Git version control interface for GNU Emacs. It is written in Emacs Lisp and distributed through the MELPA package repository, where it is the most-downloaded non-library package, with over 4.3 million downloads as of September 2024.

Like many graphical user interfaces, Magit provides a visual interface to represent version control actions; however, it uses a keyboard-centric model, and also functions as a text-based user interface. The issue of key-memorization is mitigated through use of a popup menu which displays the actions available to the user, serving as a mnemonic aid.

01History

Magit was created by Marius Vollmer in 2008, with Jonas Bernoulli assuming the role of maintainer in 2013. Since its release, Magit has seen a high degree of community involvement, with 350 individuals having contributed code to this free software project as of September 2020.

In 2018 Magit underwent a Kickstarter funding campaign which aimed to fund the maintainer for a year of work. The fundraising was successful and resulted in the project being the 27th most funded software project on Kickstarter. Since the Kickstarter funded period expired donations are encouraged to support the authors development via direct payments, GitHub's sponsorship program and various other crowdfunding services.

A Magit buffer displaying the Emacs git repository's log
A Magit buffer displaying the Emacs git repository's log

02Functionality

Magit aims to encapsulate the entire functionality of Git, and has interfaces for workflows such as:

  • Cloning a repository, and fetching/pulling from it
  • Staging, unstaging, and discarding changes in the worktree
  • Creating commits and pushing them to a remote
  • Creating branches, and either merging or rebasing onto them
    • Magit makes use of Emacs' Ediff to provide 3-way-merge functionality
  • Browsing and bisecting the commit history
  • Creating and applying patches
  • Adding notes and tags to commits

Forges

Magit's Forge provides integration with a number of forges, namely GitHub and GitLab.

Partial support is also listed for: Gitea, Gogs, Bitbucket, Gitweb, Cgit, StGit and SourceHut.

Forge currently allows for

  • Fetching topics and notifications
  • Listing topics, issues, pull-requests, notifications, and repositories
  • Creating issues, pull-requests (PRs), PR from an issue, PR reviews, and forks

03Reception

Magit is favourably covered in a number of blog posts and tutorials and a talk delivered by former Emacs' maintainer John Wiegley. It is considered by some to be a "killer app" for Emacs.

Magit is included by default in the Emacs configuration frameworks Spacemacs and Doom Emacs.

There has been interest in including Magit as a built-in feature package in Emacs, but there are issues with obtaining FSF copyright assignment from all contributors to the project.

Watch videos about MagitExplainers and documentaries on YouTube (opens in a new tab)

Sources and credits

This article is adapted from the Wikipedia article Magit, written by its contributors and licensed under CC BY-SA 4.0. Fathomly has changed the layout, removed citation markers, navigation and maintenance notices, and adjusted punctuation. This adapted version is shared under the same license. For references, see the original article.

Images, from Wikimedia Commons:

Fathomly is not affiliated with or endorsed by the Wikimedia Foundation. Spotted a problem? Tell us.