martes, 21 de junio de 2016

TIL: git ignore files locally

Adding this simple line to your .gitconfig you have an easy and semiautomated way to ignore files on your working tree, without messing the repo's .gitignore.

There's a file called .git/info/exclude that is basically another .gitignore file, but it never gets commited. So with the following line in your configs you can:

git exclude '*.csv'

And now the line itself:

exclude = !sh -c 'echo "$1" >> .git/info/exclude' -