Removed file from gitirnore but still cannot add the file in

I had to edit gitignore as it excluded a file that was needed.  I just put a # char in front to comment out the line

When I try to add the file back in I get the error message that it is excluded and that line is printed but without the # sign.

I assume I had to clear the cache so I did git rm -r --cached . followed by an add and a commit but the fle was still not added.  Git does not know its file was edited even if I exit git (windows git bash) and restart git bash.  I did go and google this problem but all that showed up was how to make git aware that stuff was ADDED.   

It asks me to do a -f to force the add.   How do I tell it to go and look at the .gitignore file and remember what is in there now and not what was in there a zillion years ago.

I am wondering if the issue you are describing might be related to something completely different.

The .gitignore file you are talking about is locally in you repository, right?

I am wondering if you potentially have a global .gitignore file that is considered in addition to the configs you have set in your local .gitignore?

The instructions below are for OS X:

If you have a global .gitignore you might find it in in your user directory. Specifically at 


You can also find the path for your global .gitignore like this:

$ git config -l | grep core.excludesfile

If it turns out that you indeed have a global .gitignore, I hope you find the file in question in there as well, and can comment it out, so that you then see the desired behavior when adding files to your repo.