Last Updated: February 25, 2016
·
2.358K
· klj613

Stop polluting your project's .gitignore

Project .gitignore should (my opinion) contain project specific files you wish git to ignore.

Your .gitignore should ignore your IDE files.

However I keep seeing IDE files inside project .gitignore files.

5 Responses
Add your response

Not sure i understand what your driving for here???

over 1 year ago ·

The point is to keep the .gitignore in your project clean and for project related things only.

Things like IDE project files (like nbproject) should be keep in your global .gitignore.

over 1 year ago ·

+1 for keeping IDE specific ignores in your own ~/.gitignore file. https://help.github.com/articles/ignoring-files#global-gitignore

over 1 year ago ·

Even better solution is to add them to your .git/info/exclude, it definitely stays inside your project and works the same as .gitignore.

Here is one sample file, I use:

# git ls-files --others --exclude-from=.git/info/exclude
# Lines that start with '#' are comments.
# For a project mostly in C, the following would be a good set of
# exclude patterns (uncomment them if you want to use them):
# *.[oa]
# *~
celerybeat-schedule.db
todo.md
.idea
.jshintrc
.ropeproject/
over 1 year ago ·

There are several project settings, that you SHOULD share, like formatting options etc.

over 1 year ago ·