Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

As question says, I am just interested to know the pros and cons of keeping track of auxiliary files of a LaTeX project in every commit of git repository.

share|improve this question
Cons: assume you edit the .tex, commit, but not compile. Now your snapshot has .tex and .aux "in disagreement". Pros: can't see anything. –  mbork May 8 '13 at 0:57
The only benefit I can see is if for some reason, you've edited one of these auxiliary files manually. –  Xavier May 8 '13 at 4:09
Related question: tex.stackexchange.com/q/17845/86 –  Loop Space May 8 '13 at 8:51

2 Answers 2

up vote 17 down vote accepted

The files that you are talking about (.log, .aux., .bbl., .blg, .toc, etc.) are created by LaTeX (or BibTeX, or any other auxiliary program) “on the fly.” They are usually dependent on the source .tex file. Since there's no information in those files that's unique to them (i.e., that can't be recovered from the source .tex file) and you would never edit them manually, there's no advantage to versioning them. At best, you commit a file that can be replicated byte-for-byte from another process, which is redundant. At worst, as mbork points out, if you commit the .tex file without compiling (and producing new auxiliary files), you are committing out-of-date information.

On the contrary, I would exclude those files from version control. In git you can do this by creating a file .gitignore in the repository directory (.git). In that file put patterns of the auxiliary files you want to ignore. Here is a list that I typically use:

# TeX, snapshot, and latexmk generated files

(Habi provides a nice link to an expansive .gitignore file on github.) You can also put these patterns in the git directory within the repository .git/info/exclude. I have a git template that has such an exclude file in it, then when I want to gitify a new document I run

$ git init --template=/path/to/template

and I'm done.

You can also do this globally. See Ignoring Files from GitHub Help.

share|improve this answer
Worth saying why there's no advantage. The point is that LaTeX or BibTeX will generate these files whenever they are run, so there's no point in versionning them as you can always recover them from existing files. The point of putting a file under version control is to be able to restore it if you make a mistake, but as it is autogenerated it is unlikely that you are editing it itself, and as it is generated by LaTeX then you can always get it back by running latex. –  Loop Space May 8 '13 at 8:54
@AndrewStacey: You're absolutely right. With the benefit of some sleep I was able to expound from my original answer. –  Matthew Leingang May 8 '13 at 11:45
Regarding the .gitignore: GitHub has an exhaustive template for a suitable ignore file for TeX related stuff: github.com/github/gitignore/blob/master/TeX.gitignore –  Habi Dec 17 at 9:57
Good link. pgfplots also adds some temp files that might make good additions to that ignore file. –  Matthew Leingang Dec 17 at 13:37

One advantage of tracking .bbl is that you can use latexdiff to track also the changes of bibliography list. (latexdiff comes with vc support)

share|improve this answer
The same applies to the table of contents, to the index, etc. –  giordano Dec 17 at 9:54

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.