How did I not know about this until now?!
.git/info/exlude is like
.gitingore but yours to mess with. Thanks @willkg!
There are three ways to tell Git to ignore files.
A file you check in to the project. It's shared amongst developers on the project. It's just a plain text file where you write one line per file pattern that Git should not ask "Have you forgotten to check this in?"
Certain things that are good to put in there are...:
node_modules/ *.py[co] .coverage
Ideally, this file should be as small as possible and every entry should confidently be something 100% of the developers on the team will want to ignore. If your particular editor has some convention for storing state or revision files, that does not belong on this file.
A reason to keep it short is that of purity and simplicity. Every edit of this file will require a git commit.
This is yours to keep and maintain. The file doesn't have to be in your home directory. (The
~/ is UNIX nomenclature for your OS user home directory). You can set it to be anything. Like:
$ git config --global core.excludesfile ~/projects/dotfiles/gitignore-global.txt
Here you put stuff you want to personally ignore in every Git project. New and old.
Good examples of things to put in it are...:
*~ .DS_Store .env settings/local.py pip-log.txt
This is a kinda mix between the two above mentioned ignore files. This is things only you want to ignore in a specific project. More or less "junk files" specific to a project. For example if you, in your Git clone, has some test scripts or a specific log file.
Suppose you have a little hack script or some specific config that is only applicable to the project at hand, this is where you add it. For example...:
I hope this helps someone else who, like me, didn't know about
.git/info/exclude until 2016.