There are a fair number of files that you probably do not need to commit into git, since they are built, are generated by NB or contain environment specific information.
If you create a project that uses Ant as the build mechanism, you usually end up with a directory tree that looks like this...
You should probably put the build, dist and nbproject/private directories (and their children) into your .gitignore.
If you want to be very aggressive about excluding files, you may want to consider excluding all the files that appear in nbproject EXCEPT project.properties and project.xml. The other files in the nbproject directory are regenerated by NetBeans when the project is opened.
There should be no NetBeans-specific files in your .gitignore. The .gitignore file is project-specific but shared between developers, IOW there should only be things in there that are common for all developers working with the code (including ones that use OSX, Linux instead of Windows and Eclipse, IntelliJ or Notepad as editors) and that are specific to the project.
If there are some files that you would like to ignore based on your specific environment (like e.g. Windows Thumbs.db and desktop files or NeBeans nbproject directories) you should do that in your global ignore list, not in the project-specific .gitignore – if only because then you don't need to add them to every single of your projects individually.
If the files you want to ignore are both specific to your environment and specific to the project, put them into that repository's .git/info/exclude.