Shreyas Minocha

Global gitignore versus local gitignore

As you might be aware, git supports global gitignore files, allowing us to define ignore patterns for files across system.

The global gitignore is best reserved for patterns for things like:

Everyone needs different combinations of these—repositories’ local .gitignores shouldn’t be cluttered with these.

The local .gitignore should, instead, hold project-specific patterns. These may be related to your dependency management tools, frameworks, coverage checking tools, the rest.

This isn’t an original thought by any means, but it’s a big pet-peeve 🐶.

Shreyas' Avatar

Shreyas Minocha