What are the advantages of using version control (git, etc.) in LaTeX documents

I'm also someone who uses version control as a single user. All of Caramdir's reasons are ones that I agree with, and I'll add the following:

  • Tagging. When I send a paper off to a journal, I can "tag" that version and so even if I make my own improvements in the meantime, when I get the referee's report back then I can easily revert to the version that the comments are on. Plus it's easy to see when I sent a copy to which journal or to collaborators or to eprint repositories.
  • Working with collaborators even if they don't have the VCS themselves. I can make a branch copy for my collaborator on my own system and simply copy in their corrections to that each time, then merge them into the main branch as if they'd been using the VCS all along. Keeps the advantages of using version control but without requiring all collaborators to use it.
  • Maintaining different versions. Caramdir already said this, but I'd like to emphasise it as it happens a lot more than one might expect. When I write a paper, I write it first for myself. So I make life easy on myself by using lots of macros and the like to make it easy for me to type. But then I want to submit it to a journal, send it to the arXiv, send it to some other eprint servers, put a copy on my webpage, put an accessible copy on my webpage ... Each of these might require a slight change to the document, for example one eprint server I use doesn't have a decent set of fonts so I have to "downgrade" my papers before sending it there. But of course, I'm still working on the paper after sending a version to all these different places and so a VCS helps me keep all of them in step.

Incidentally, I switched to using a version control system around about the time I started taking online notes of everything that I did. So I wrote up some notes on the process here. I also found an article (also available as a wikibook) on the subject that was very helpful to me in deciding to switch to a version control system and on what to look for in one.


As a single user the main advantages are

  • Automatic backups: If you accidentally delete some file (or part of a file) you can undelete it. If you change something and want to undo it, the VCS can do so.
  • Sharing on multiple computers: VCSes are designed to help multiple people collaboratively edit text files. This makes sharing between multiple computers (say your desktop and laptop) particularly easy. You do not need to bother if you always copied the newest version; the VCS will do that for you. Even if you are offline and change files on both computers, the VCS will merge the changes intelligently once you are online.
  • Version control and branching: Say you published some class notes as a pdf and want to fix some typos in them while simultaneously working on the notes for next year. No problem. And you only need to fix the typos once, the VCS will merge them to the other versions.

Using revision control makes you unafraid to make radical changes to your document. As one of my friends, Peter Boothe, put it,

you can now freely throw away bits and pieces, secure in the knowledge that if you actually want them back, they are there in the revision control system. Interestingly, almost nobody actually uses this feature. Revision control systems are not there to save your old work. They are there to give you permission to throw that old work away.