Emacs version control
July 30, 2008 at 10:33 pm 3 comments
I discovered how emacs version control worked today… and was duelly impressed. (Having previously thought that it didn’t work at all well – guess this means I should learn to read manuals).[1]
Regardless, emacs comes with a unified version control front-end which supports back-ends for most version control systems : I believe this includes git, svn and bzr). This can do most of the things that one wants to do.
One of my only irritations is that one can’t revert individual lines of the diffs that it shows.
Summary for the impatient
Emacs version control is wonderful, I’m dim for not realising this earlier. To make it work do the following:
C-x v = in a file for a diff
To submit:
C-x v d <TOP LEVEL DIR> to get a list of all modifed files, then mark everything (hold down m) and press C-x v v.
If you want to see diffs for individual files press v=.
[1] As an aside, one of the reasons I hadn’t found this out earlier was because I was under the false impression the mode help (C-h m) would show all relevant keybindings… I’m not quite sure why, C-h b is (strangely!) better for this purpose.
Entry filed under: Uncategorized. Tags: emacs, version control.
1.
Rodrigo Amestica | August 7, 2008 at 3:36 pm
I just wish that maintenance for pcl-cvs is just revived. I think that this mode supports only cvs, which happens to be what I need to use.
2. Interesting Emacs Links - 2009 Week 11 « A Curious Programmer | March 15, 2009 at 5:48 pm
[...] are posts on searching multiple buffers, emacs version control and emacs buttons within the same [...]
3.
Ivan Andrus | March 17, 2009 at 4:02 am
I’m not sure if this is what you are wanting, but I use diff-split-hunk (C-c C-s) to take a hunk and split it into two, and then I can apply the hunk with diff-apply-hunk (C-c C-a) and it asks me if I want to revert the hunk, which I do (prefix argument also forces a reverse). This could of course be made into a function which quite easily.