How to use git from emacs [closed]
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this questionThe 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?
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
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.
Just have a look here: http://www.emacswiki.org/emacs/Git
IMO Egg, fork of Magit, is good too.
精彩评论