Last active

Git: .gitignore file for LaTeX projects

  • Download Gist
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23

Excellent! Thanks for this!

I might consider adding '*.synctex.gz'.

Thank you! Good idea, I added it.

Why not use this instead:

$ cat .gitignore

Because it's decently rare that a .tex file exists by itself, there's BibTeX files, figures, usually some sort of misc notes you want (I even have a rake file using rake-latex from Oxford Uni).

All that said, if you really do have a .tex file in isolation, that's a good solution :)

excellent, just what i need! thanks.

Thank you for this great file !
I forked it for Mac users :

If using latexmk to manage the compile process, add *.fdb_latexmk

I added *\#* to my list to not track the emacs backup files.

I added *.pdf since this is an output file and not a source file. The same could apply to *.dvi.

Thanks !, very useful.

if using the pagebackref option of the hyperref package you also get a *.brf file.

I would sort it alphabetically :) Good one!

While for AUCTeX you also get files like:

Thank you Stefan, this is nice and useful. You may also want to include *.lol (List of Listings), produced by the listings package.

Thank You, indeed. My "manuscript" got rather large and manually tracking changes piecemeal got unmanageable, thankfully I opted way back then to compose it in \LaTeX so now that I've been able to regenerate it from ancient source, I'll be able to track it, too.

Just what i was looking for, great! What about adding *.pdf? And for TexMaker users


is useful also.


BTW, biber creates *.bcf and *.run.xml files.

*.snm and *.nav for beamer!

Thanks for cleaning up my fat repo!

I see multiple comments suggesting adding *.pdf, but as of yet it was not included.. Is there an argument to leave it out?

This is perfect, Thanks!

joostrijneveld: adding *.pdf to a standard .gitignore is a bad idea since pictures in latex documents often are included in pdf format.

I would also argue that it's pretty convenient for someone not interested in editing the document to have easy access to the output pdf file, without having to download any non-common packages and building it manually.


Thanks for your sharing. I propose to add *.run.xml which is generated by biber.

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.