Emacs Commands

a part of MarkD's Guide to CVS
The O'Reilly Learning GNU Emacs book has a good chapter on using version control in emacs.

In general, the VC (version control) commands are C-x v followed by one command character.

Be sure your CVSROOT environment variable is set correctly before starting emacs.

Sometimes emacs opens a cvs-controlled file in Read Only mode. Kai Wu figured out what's going on

Task Reference

Action How to do it
Add a new file to the repository Create the File. Save it
C-x v i
(this adds the file, but doesn't commit it)
C-x v v
Enter the "Initial Revision" comment
C-c C-c
Revert a buffer to the last revision C-x v u
See differences between buffer and last revision C-x v =
See differences between two revisions C-u C-x v =
You'll be prompted for file, starting revision, and ending revision.
Specify the revisions either by revision number or by label.
Retreive a given revision in another window C-x v ~
You'll be prompted for a revision
See revision history C-x v l
(That's an "ell")
Label a tree C-x v s You'll be prompted for a label name
Retreive file names from a labeled snapshot C-x v r
You'll be prompted for a label name.
This checks out every registered file underneath the current directory, which might not be what you want to do.
Do a Bulk Check-in C-x v d
Mark files to be checked in. (like in DirEd, move the cursor to the name and type m)
C-x v v
Enter the revision comment. Note that this will put the same revision comment on all checked-in files, so be sure that the comment really applies to all of the files.

Keystroke Reference

Keystroke What it does
C-x v i Register a file for version control
Bound to vc-register
C-x v v Commits a modified file that's already been registered for version control. Use
C-c C-c
to save the revision comment and commit the change.
Bound to vc-next-action
C-x v u Revert a buffer to the last revision
Bound to vc-revert-buffer
C-x v = See differences between buffer and last revision.
Bound to vc-diff
C-u C-x v = See differences between two revisions of a file.
You'll be prompted for file, starting revision, and ending revision.
Specify the revision s either by revision number or by label.
Bound to vc-diff
C-x v ~ Retreive a given revision in another window.
You'll be prompted for the a revision
Bound to vc-version-other-window
C-x v l (that's an "ell")
See revision history
Bound to vc-print-log
C-x v s Label a tree (a.k.a. Creating a snapshot)
You'll be prompted for a label name
Bound to vc-create-snapshot
C-x v r Retreive file names from a labeled snapshot
You'll be prompted for a label name.
This checks out every registered file underneath the current directory, which might not be what you want to do.
Bound to vc-retreive-snapshot
C-x v d Bring up a dired-style directory listing
Mark files for check-in by using m
Actually check things in with
C-x v v

markd@badgertronics.com
$Id: emacs.html,v 1.2 1999/12/23 21:49:09 markd Exp $