DEV Community

Global Git Ignores

Graham Cox on January 20, 2017

This is a feature that I find invaluable, but that I don't recall seeing a huge amount of documentation on at the time I started using it. (Turns o...
Collapse
 
mhutter profile image
Manuel Hutter

To unignore something, add it to the local .gitignore file with a leading !

Collapse
 
0xcmp profile image
cmp

Be careful with this. Sometimes when you're setting up new projects those files are already ignored, but won't be ignored for anyone else unless they also have a global ignore like yours. (And vice-versa and thing not meant to be ignored will be ignored)

Better to do on a per project basis

Collapse
 
tpenguinltg profile image
tPenguinLTG

According to the gitignore man page, the "default value [for core.excludesfile] is $XDG_CONFIG_HOME/git/ignore. If $XDG_CONFIG_HOME is either not set or empty, $HOME/.config/git/ignore is used instead."

git-scm.com/docs/gitignore