emacs version control commands

emacs version control (scm)

emacs front end for Git, Subversion, Mercurial, CVS, Perforce, PVCS and SCCS

For keyboard enthusiasts (ie productive IT professionals) – the emacs version control abstraction is second to none. Even Tortoise (the de-factor ui for windows) has different windows for Git, Subversion and so on. But the e-macs version control keyboard interfaces are powerful and consistent across Git, Mercurial, Subversion, CVS, SCCS, Perforce and more.

vc-dir – the Version Control Directory

Ctrl-x v d -- open the version control directory listing

This view is the centrepiece of the e-macs version control offering. You can see the entire change set of files including the files and folders that

  • are unversioned (unregistered) [i]
  • exist only in the external repository [+] on root or subsequent repository tree folder.
  • have been registered but not committed [v] then comment then [Ctrl c c]
  • have recently been committed [g] to wipe away “up-to-date” entries in the vc directory.
  • have been changed in the working directory
  • contain conflicts against the repository
  • were changed and by which revisions
Subversion Only As per usual with Subversion - you should update before any deletion and/or renaming actions.

The command to get into the version control directory is Ctrl-x v d (for vc directory)
Press the characters shown above to move the file or folder to the next logical version control stage.

Powerful Emacs Version Control Views

“a powerful view keeps easy things easy and makes hard things possible”

Powerful views disseminate an incredible amount of information at a glance, whilst staying simple. The best views highlight an aspect of a complex subject and quickly communicate information and intelligence while you read, drill down, investigate, and explore.

File Line Diff Compare | emacs version control views

Inside the file, you want to know which lines are different between the working copy file and the repository file.

Ctrl-x  v  =

Do this whilst visiting the file in an e-macs buffer. The alternative is to type Alt-x and then vc-diff

You get colour coded information (easy for the brain to devour). Pluses mark the lines that will exist after you commit into version control and minuses mark the lines that will be removed.

Who Changed What Line When | emacs version control views

Ctrl-x  v  g

Do this whilst visiting the file in an e-macs buffer. The alternative is to type Alt-x and then vc-annotate

This view prefixes each line with the person that last changed it and when.

Act On All Files in the e-macs version control directory

By moving to the dot slash ./ line – you can act on all files and folders listed in the emacs version control directory (vc dir).

You can do this only if all the files and/or folders are in the same version control state.

C-x v ~ vc-version-other-window -- look at other revisions

C-x v u vc-revert-buffer -- undo checkout

C-x v c vc-cancel-version -- delete the latest revision (often it makes more sense to look at an old revision and check that in again!)

C-x v d vc-directory — show all files which are not up to date

C-x v s vc-create-snapshot — tag all the files with a symbolic name
C-x v r vc-retrieve-snapshot — undo checkouts and return to a snapshot with a symbolic name

C-x v l vc-print-log — show log (not in ChangeLog format)
C-x v a vc-update-change-log — update ChangeLog

C-x v m vc-merge
C-x v h vc-insert-headers

M-x vc-resolve-conflicts — pop up an ediff-merge session on a file with conflict markers

Leave a Reply

Your email address will not be published. Required fields are marked *