In some cases you might want to add one or more ignore rules for a git repository that you don't want to check in.
For example you might have a script that you use to manually test stuff - foo.sh
. If you don't want to check in this file
you can of course add foo.sh
to .gitignore
, but foo.sh
does not mean anything to anyone but you. A better option would
therefore be to add foo.sh
to .git/info/exclude
. This file will not be checked in, and no one but you need ever know
about foo.sh
.
But say you tend to create a foo.sh
in all the git repositories you clone. Then you could edit the .git/info/exclude
of
all those repos, or you could create a global excludes file. To do this, simply:
Create a file and name it whatever you like. E.g: