Source: The gitignore
documentation
The core.excludesFile
git configuration variable can be used to define an arbitrary file location (~/.gitignore
in this example) that contains patterns for git to always ignore.
Example usage:
$ git config --global core.excludesFile ~/.gitignore