Monday, August 29, 2011

git: how to ignore certain file types globally

I wanted to tell git not to ever include .pyc files in any project, anywhere on my system, instead of having to specify a separate .gitignore file in every python project directory. A simple google search solved the problem; here's one way to do this:

Create a ~/.gitignore file in your home directory:

.DS_Store
*.pyc

Then run:
git config --global core.excludesfile ~/.gitignore

That's it!

 

thanks to [source]

No comments: