---
title: "Use Magit"
canonical: "/2016/11/25/use-magit/"
date: "2016-11-25"
author: "Alok Singh"
tags: []
---


If you're using Emacs, then I'm sure you've heard of Magit.
Go read something else, like Helen DeWitt's [*The Last
Samurai*](https://en.wikipedia.org/wiki/The_Last_Samurai_(novel)).

If you're using Vim, then you should use
[Vimagit](https://github.com/jreybert/vimagit) as your interface to git.

`git` has the ability to stage and commit *pieces* of a
file rather than the whole file. It's crucial to being
able to edit a file naturally and yet still [commit
atomically](https://www.freshconsulting.com/atomic-commits/). This
ability is hard to use without some sort of wrapper. `git add -p` sucks.
Try it for yourself if you don't believe me.

Vimagit solves that problem. Try it out. Then the only things left to
do are push your code, which can be done on the command line, or with
[Fugitive](https://github.com/tpope/vim-fugitive).

I recommend using the `next` branch. If you use
[vim-plug](https://github.com/junegunn/vim-plug), add this line to your
`vimrc`:

```vim
Plug 'https://github.com/jreybert/vimagit', {'branch': 'next', 'on': ['Magit', 'MagitOnly']}
```
