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.
Not sure i understand what your driving for here???
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.
+1 for keeping IDE specific ignores in your own ~/.gitignore file. https://help.github.com/articles/ignoring-files#global-gitignore
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):
There are several project settings, that you SHOULD share, like formatting options etc.