Git appendix wizard how to basic face

git add adds ignored files

So I'm trying to remove a previously traced directory from git that works, but it's being added again with each subsequent etc. Here is what I did:

Add .gitignore in the root of the project:

Do the following:

So far So good, this removes the directory from the remote repository. The problem is when I run it later it tells me the node_modules directory doesn't and keeps adding it back on the future obligation.

What am I and / or how do I find the root of my problem?

From here:

The git add command doesn't ignore files by default.
The git add command can be used to ignore files with the -f (force) option.

Additional information Comments:

I am tracking the .gitignore file.

gives node_modules / as expected.

Not to use the sub-areas.


I have an example that is shown replicating the output of the following:


Summary of answers and comments from below, the issue was while encoding my .gitignore file. I had to create the file on windows 8 and it turned out to be UTF-16 with BOM (according to the answer below). After a few google searches, it seems this is the default encoding with powershell and I can confirm that saving as UTF-8 seems to fix the problem.

tldr; Probably not, use this method to create .gitignore files or be prepared to change the encoding

Share improve this question 2015-09-04