I have been using the Git bash for doing my commits until now and have never seen .gitignore file getting commited. Recently I moved over to Aptana Studio 2 for doing my projects and installed the EGit Eclipse Plugin for version control. Whenever I commit now the .gitignore file also gets commited. I even tried to include the line *.gitignore in the .gitignore file itself, but that doesn’t help.
How can I ignore the .gitignore file?
The actual answer to your question is (assuming the .gitignore file you are referring to is in the root of your project structure):
A.) If you’re using windows make sure that .gitignore isn’t a hidden file. Right click on the file in Windows Explorer and select properties, then make sure hidden isn’t checked off. This has to do with an issue Eclipse based IDEs have with hidden files.
B.) Edit .gitignore and add the following on a line by itself:
/.gitignore
C.) Save the file then right click on it in Aptana and click on untrack under the team menu.
EGit should now parse the file as expected but not add it to version control.