29

The previous answers on this topic seem out of date so I am asking again in search of more timely info.

I use emacs development sources (24.0.50.1) to build my own emacs. Yes, I drank the Kool-Aid.

I recently started using git to clone development repositories and for my own projects. I want to use of git from within emacs, and I only want to learn one interface.

It appears that vc-git and magit are the leading choices. Is that right?

It looks like vc-git would be the way to go if I often used other VC systems (which I don't), and that magit is the best fit since I only plan to use git.

Does that sound right? Or am I missing something?

4
  • 1
    Update: I have now used both magit & vc-git. I found sanityinc's advice to be right on... namely that they complement each other & you might as well use both... and enjoy
    – myglc2
    Commented May 26, 2011 at 1:01
  • 1
    Two years have passed, and this still shows up near the top in searches for git and emacs - have things changed? Is vc-git still the way to go?
    – gcbenison
    Commented Jun 4, 2013 at 22:22
  • 1
    @gcbenison Magit is probably the best way to go, although the Egg fork is getting commits recently too, so it's worth grabbing it via Melpa.
    – ocodo
    Commented Jun 19, 2013 at 15:18
  • 2
    Now, 4.5 years of emacs + git development later, I use emacs+magit for 95% of what I do in git, falling back to the git command line occasionally. About a year ago magit received a complete facelift and a large number of mind-bending changes. It might have been better if the new version was called magit2 rather than being slipstreamed into magit. In any event, now that I have digested the latest magit Kool-Aid I am an even happier camper!
    – myglc2
    Commented Dec 28, 2015 at 21:42

3 Answers 3

30

Magit is a wonderful choice because it gives you a good project-level view of your repo and its history, and lets you do neat things like stage/unstage individual diff hunks in the files you've edited. Plus, it's very actively used and maintained.

I personally use vc-git in addition to magit; it's handier than magit for various operations on the current file, e.g. viewing a diff (C-x v =), getting the file's history (C-x v l) or reverting the file to a pristine state (C-x v u).

BTW, magit's home on the web recently changed to this: https://github.com/magit/magit

3
  • Thanks sanityinc. I have now tried out both. I found your advice to be right on. Mark me down as a happy magit + vc-git camper!
    – myglc2
    Commented May 26, 2011 at 0:46
  • Great! Maybe you want to go ahead and 'accept' this answer then, so that the question is closed?
    – sanityinc
    Commented May 26, 2011 at 7:33
  • The only thing that bugs me about magit is there is no shortcut to do a commit afaik - you need to go into status first.
    – Mike Vella
    Commented Aug 15, 2013 at 22:38
6

I use and love Magit. It's easy to install on other systems if you need. The commands I use often are:

C-i - While having any file open to open up the Magit "changes" window to see my changes to all files. Pressing tab on any filename and I get a colored diff of all changes. Pressing s stages them or k reverts the file (and any buffers using the file.) P to push all my staged changes.

I also see all my stashes and can tab on any of them to see a diff, k to drop them. All commands are so consistent.

Doesn't get much easier and smooth than that!

Full doc here.

2
  • Also, it's available in the marmalade repo
    – Drew
    Commented Feb 15, 2012 at 22:14
  • Also available via Melpa too.
    – ocodo
    Commented Jun 19, 2013 at 15:18
2

Just have a look here: http://www.emacswiki.org/emacs/Git

IMO Egg, fork of Magit, is good too.

3
  • 1
    In my experience magit is nerv wreckingly slow. Have you experienced the same with magit or Egg? Commented May 8, 2011 at 8:34
  • I really haven't faced any performance issue. My only gripes were with the features
    – manojlds
    Commented May 8, 2011 at 8:42
  • 1
    When was the last time you tried magit? It's been very actively developed, and the last commit to Egg was apparently in early 2009.
    – sanityinc
    Commented May 8, 2011 at 18:21

Not the answer you're looking for? Browse other questions tagged or ask your own question.