explaingit

magit/magit

7,093Emacs LispAudience · developerComplexity · 2/5Setup · moderate

TLDR

A Git client built into the Emacs text editor that lets you stage, commit, push, rebase, and manage your entire version control workflow with keyboard shortcuts without leaving the editor or typing raw Git commands.

Mindmap

mindmap
  root((repo))
    What it does
      Git inside Emacs
      Keyboard driven
      Text based UI
    Core features
      Interactive staging
      Rebase tools
      History view
    Install methods
      MELPA package
      NonGNU ELPA
      Distro packages
    Audience
      Emacs developers
      Power users
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Stage individual lines or hunks of a file and commit them without leaving Emacs

USE CASE 2

Resolve merge conflicts interactively inside your editor using Magits diff interface

USE CASE 3

View and navigate your full repository commit history inside Emacs with keyboard shortcuts

USE CASE 4

Rebase, cherry-pick, and manage branches entirely from the keyboard without switching to a terminal

Tech stack

Emacs LispEmacs

Getting it running

Difficulty · moderate Time to first run · 30min

Requires a working Emacs installation, install via MELPA or NonGNU ELPA package manager.

In plain English

Magit is a Git client built directly into the Emacs text editor. Rather than switching to a separate application or running Git commands in a terminal, Emacs users can manage their entire version control workflow inside the same editor where they write code. The project describes itself as a "Git porcelain," meaning it presents Git's functionality through a polished, user-facing layer rather than exposing raw commands. The key idea is that almost everything displayed in Magit's interface is also something you can act on by pressing a key. You can stage individual lines of a file, commit, push, pull, rebase, resolve merge conflicts, view history, and perform dozens of other Git operations without leaving Emacs or typing a full Git command. The interface is text-based, matching Emacs's overall style, but it organizes information in a way that makes common tasks faster than either a graphical Git client or the command line for many experienced users. Magit has been actively developed for many years, with a large and enthusiastic user base. It is maintained by a small team, currently led by Jonas Bernoulli, who started the project alongside Marius Vollmer. Development is funded partly through donations, and the README asks users who find it useful to contribute financially given the gap between the number of users and the number of maintainers. The project is installed through Emacs package managers like MELPA or NonGNU ELPA, and has packages available in various Linux distribution repositories as well. It comes with a detailed manual, a FAQ, and introductory articles and screencasts for people new to it. No prior deep knowledge of Emacs is required to use Magit, though familiarity with Emacs basics helps.

Copy-paste prompts

Prompt 1
I just installed Magit in Emacs and want to stage only specific lines of a file rather than the whole file. Walk me through the interactive staging workflow step by step.
Prompt 2
I am in the middle of a rebase in Magit and hit a merge conflict. What keystrokes do I use to view the conflict, choose a resolution, and continue?
Prompt 3
How do I use Magit to cherry-pick specific commits from one branch and apply them to another?
Prompt 4
I want to set up Magit via MELPA in Emacs for the first time. What is the minimal configuration I need in my init file to get it working?
Open on GitHub → Explain another repo

← magit on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.