Quick Tip: Keep a Global Gitignore File

Published January 9th, 2020
1 minute read
Warning!
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.

Want Updates?

Sign up here if you want to stay in the loop about new articles or products I'm making.
I'll never spam you. Unsubscribe at any time.
Copyright ©2024 Austen Cameron