Emacs Tip of the Day: VC – The Emacs Version Control Interface

by

VC is the Emacs Version Control Interface that can be used to interact with a variety of Version Control Systems. What this means is that regardless of which version control system you use, you have a uniform command set that you can use to interact with it. So even if you move to a new version control system, you are still ahead on the learning curve. This, of course, is a corner case and not the real reason you should use VC. The real reason you should use VC is that it allows you to use your version control through your editor itself, making it a part of your workflow and therefore effortless.

The way I work is as follows: Once I’ve made my changes I review the diff to see if it is satisfactory (C-x v =). Next, I use the magical C-x v v (Perform the appropriate next version control operation) which ‘guesses’ what I want to do and prepares the commit. Preparing the commit means asking for the commit message and doing the actual commit. And Lo! I’m done.

Sometimes I’ve made a lot of changes in multiple files which I want to check-in together in a single commit. In this case, I run vc-dir (invoked by C-x v d) which gives me a buffer with version controlled file information. From here, I can mark the files I want to commit and run C-x v v to ‘do the right thing’. Simple and straight forward, as always.

About these ads

Tags: ,

2 Responses to “Emacs Tip of the Day: VC – The Emacs Version Control Interface”

  1. CDK Says:

    Bitkeeper is one vc system not supported by vc-mode. Check bk.el adds support for BK with the same keybindings.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Follow

Get every new post delivered to your Inbox.

%d bloggers like this: