Search code examples
gitgitignore

Can't disappear "untracked" folder in git status


I'm new to Git. A couple of days ago I tried to undo a "git add --all" with "git reset" after a quick Google suggested that. Luckily it appears no material harm was inflicted on my working directory, however Git has added a folder of angularjs modules I had listed in .gitignore, and now this folder (and everything in it) is showing up as "untracked" in "git status". It didn't prior to the reset, and nothing else in gitignore is doing this. I've tried a few solutions including "git rm -r --cached node_modules" and this Git untracked files list is wrong but it's still there. All suggestions appreciated!


Solution

  • (repeats my last comment under Impression's reply). I solved it. Maybe I have a malformed gitignore, but I accidentally discovered that the first line is being ignored by gitignore (yeah, you read that right). When I added a new entry "nothing" to the top of git ignore, it stopped listing node_modules as"untracked". Whatever.