![Sinan Aksay smiling with cool shades](/static/profilepic-7653dda15aabda48e05e48c9f7a34cf0.jpg)
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](https://webmention.io/avatar/pbs.twimg.com/7dceab46dd968a0095b0d8a8cf8343b8474b8b130668ac8d1b73edf9a15dc844.jpg)
Gokhan Sari replied
Upcoming: How to convince your colleagues to add .DS_Store to their global .gitignore.
![wunnle](https://webmention.io/avatar/pbs.twimg.com/a6a4cac3d2d11f266e062498e7b3410a190b9f6b971afbd5f92aa7d5d82a38a9.jpg)
wunnle replied
Step 1: Buy a Nerf gun