Quick Tip: Keep a Global Gitignore File

Published January 9th, 2020
1 minute read
This was written over two years ago, so some information might be outdated. Frameworks and best practices change. The web moves fast! You may need to adjust a few things if you follow this article word for word.

Have common files you don't want to version in any projects? -- put them in a global gitignore file! I don't know about you, but I'm sick of adding .DS_Store or .vscode to gitignore files on a per-project basis.

Run the following command in your terminal:

1git config --global core.excludesfile ~/.gitignore_global
1git config --global core.excludesfile ~/.gitignore_global

Now you can edit the ~/.gitignore_global file just like any other, but it will apply everywhere.

Take a look at my global gitignore file to see if any of those would help you.

Enjoy this article? Follow me on Twitter for more tips, articles and links.
😢 Awww, nobody has liked or mentioned this on Twitter yet.

Join the Newsletter ❤️

A most excellent monthly newsletter with code & design tips, curated links and more!
I'll never spam you. Unsubscribe at any time.
Copyright ©2023 Austen Cameron