The right .gitignore setup for your project

I think, the best way to have a clean .gitignore on your project is, to add only project specific files and directories to the project .gitignore.

If you have files (e.g. IDE files/directories) to ignore globally add this to your global .gitignore file.

Unix: ~/.gitignore_global
Win:  C:\\documents and settings\\<your username>\\gitignore_global.txt

If you need a different position for your global file, you can change the config with the command below:

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

If you think this is a good setup or you have other ideas, please let me know! I’m open for every discussion.

Hint: gitignore.io is a very good tool to find the right setup depending on your favored IDE.