Introduction

Magit is an Emacs Git client that is praised by many users . It was one of the reasons I switched to Emacs back when I stumbled across an Emacs video tutorial for the first time. I remember I was impressed by the intuitive UI/UX. In this blog post, I will go over the main Magit interface — Magit Status — and hopefully you will get to see why Magit is awesome .

Magit Status

This is the entry point interface that appears when you invoke Magit. It contains quite a lot of information, even if it doesn’t seem so at first glance. The following image is an example of the Magit Status interface:

There are two sections. The first displays four pieces of information — Head, Merge, Push, and Tag — which refer to:

  • Head— the last commit of your local branch
  • Merge— the remote branch you merge changes into
  • Push— the remote branch you push changes to (for example, a fork you contribute to)
  • Tag— the latest tag on your local branch, and how many commits you are ahead of it

The second section contains the recent commits, which are collapsed by default to avoid clutter. Here’s what the status interface looks like when you open the recent commits section using the TAB key:

This still doesn’t look like the a lot of information I described earlier, but the missing sections are just as informative: Magit only shows a section when it has something to report, and the lack of a staged or unstaged section here means nothing has changed.

In the following image, I modified the repository so these sections now appear:

First, the untracked files (collapsed by default). Second, the changed files under the unstaged section, including their changes (also collapsed). Third, the staged changes, similar to the previous section but containing only what was staged.

The interesting part about the Magit status interface is that it is interactive: you can stage or unstage changes, and add, delete, or hide untracked files. The list of possible interactions is far too long to cover here. To give you a better picture, it feels like piloting an airplane with the whole control panel within reach — except that here everything is at your fingertips. The following image shows that control panel:

The above image shows the Magit commands menu, which is hidden away and can be accessed using the ? key. It lists the commands available from the status interface, covering almost anything you would need, all accessible through a single key — and most are easy to remember because the first letter of the action is the shortcut key.

Looking back at the screenshots in this post, this single interface gives you the entire state of the repository while also providing all the commands you need, with excellent discoverability whether you are coming from the Git CLI or just starting out with Git through Magit.

Conclusion

The design behind Magit’s status interface never ceases to amaze me. I had planned to cover several other topics, such as how Magit approaches some Git workflows, but I found myself writing a lot about just the status interface, so I decided to keep this post short. In future posts I would like to write about simple workflows like staging, committing, and navigating between branches, as well as more advanced ones like cherry-picking and rebasing (which don’t feel advanced at all when you’re using Magit).