Chapter 16. Version Control Under Emacs

The Uses of Version Control

If you write either large programs or long documents, you have probably been caught at least once in a situation where you’ve made changes that turned out to be a bad thing, only to be confused and stymied because you weren’t sure exactly how to reverse them and get back to a known good state. Or, perhaps you’ve released a program or document to someone else, then gotten a bug fix or a comment that you couldn’t integrate properly because you couldn’t recover the old version that person was working with. Perhaps you’re a member of a development or documentation team and have felt the need for some way to keep change histories, indicating who was responsible for each change.

These common kinds of problem can be addressed with a version control system. A version control system gives you automated help at keeping a change history for a file or group of files. It allows you to recover any stage in that history, and it makes getting reports on the differences between versions easy.

There are three version control systems widely available on the UNIX machines that host most Emacs versions—SCCS, RCS, and CVS. All are pretty good at their jobs, but historically they’ve been less used than they perhaps should have been. One reason is that all three have rather complicated and hairy interfaces. Also, they haven’t generally been integrated with editors, so using them involved a tedious two-step process whenever you wanted to ...

Get Learning GNU Emacs, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.