Sinan Aksay smiling with cool shades

on December 24, 2020

Global .gitignore

git1 min read

Instead of adding platform-specific files like .DS_Store to .gitignore file of every single project, you can just create a global .gitignore file.

To do that, first create a new .gitignore file on the root (or wherever you want):

touch ~/.gitignore

Add the files you don’t want to track to it:

echo .DS_Store >> ~/.gitignore

Finally tell introduce your global .gitignore file to git:

git config --global core.excludesfile ~/.gitignore

Mentions

2 replies, 1 likes

Gokhan Sari
Gokhan Sari replied
Upcoming: How to convince your colleagues to add .DS_Store to their global .gitignore.
wunnle
wunnle replied
Step 1: Buy a Nerf gun
Discuss on TwitterEdit on GitHub

Enjoyed this article?

Get new ones
in your inbox!

No spam. Unsubscribe whenever.