Recent Posts

Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here:
Cookie Policy

Simple Version Control

About once every six months or so I spend the morning happily overwriting an existing piece of work. Either that or I unwittingly delete whole sections, only to discover my mistake later that day or worse, later that week or even month.

That’s were Emacs simple version control comes in handy. Add the following to your .emacs file: (courtesy of the Emacs Wiki)

The last 16 versions of the file are kept, the versions indicated by ~ ver ~
Having all of those versions can sometimes make it difficult to find files under dired. Fortunately, dired-x has a mode that omits uninteresting files. Add the following to .emacs

(require 'dired-x)
(setq dired-omit-mode t)

Now just hit C-x M-o (or M-o on older versions of Emacs) to omit those files.
16 past versions combined with my regular backup routine have proven enough for me to find the accidentally deleted text. For a more in depth discussion see http://www.emacswiki.org/emacs/ForceBackups

I assume such VC backups can be centrally stored in one folder, the same as the emacs auto-backup features.
It is a good habit to enable this but I am annoyed with so many ~ files since from time to time I also use terminal or file GUI to navigate. Perhaps I need to be heavily ass kicked one day to start using it :).
Good post!