SVN ignore

Sometimes you have files in your SVN folder that you don’t want to include in the svn. For example let’s say svn status gives the following result:

M       data/data.tex
?       data/data.aux
?       mydoc.bbl
?       mydoc.blg
?       mydoc.log
?       mydoc.out
M       mydoc.tex
M       mydoc.pdf
?       mydoc.toc

All these files are temporary files that LaTeX creates and I don’t want them in my SVN. Is there some way that I don’t have to see them anymore everytime I check what I have changed? YES! There’s a SVN property that you can set for a folder which is called "ignore".

So to ignore all files with the extension aux in the current directory, you can do this:

svn propset svn:ignore *.aux .

But doing that for every one of the five filetypes is already too much for me. Also, the setting applies only to one folder, I would need to repeat the same thing for each subfolder! Fortunately, you can (a) specify a file which contains the stuff to be ignored and (b) call the command recursively on all subfolders. So I write all the things I want to ignore (*.aux, *.bbl, *.blg, *.out, *.toc) into the file ignorethisyoustupidsvn.txt (one pattern per line) and execute the following command:

svn propset svn:ignore -R -F ignorethisyoustupidsvn.txt .

Now let’s do svn status again:

M       data/data.tex
M       mydoc.tex
M       mydoc.pdf

Yay 🙂

Links: SVN properties documentation, Getting svn to ignore files and directories (superchlorine)

This entry was posted in Version control and tagged by swk. Bookmark the permalink.

About swk

I am a software developr, data scientist, computational linguist, teacher of computer science and above all a huge fan of LaTeX. I use LaTeX for everything, including things you never wanted to do with LaTeX. My latest love is lilypond, aka LaTeX for music. I'll post at irregular intervals about cool stuff, stupid hacks and annoying settings I want to remember for the future.