Reputation: 2777
I have some files that were being tracked by Git:
But then I decided I wanted Git to ignore them. So I added them to the .gitignore file, then ran these commands:
git rm --cached content/.htaccess
git rm -r --cached admin/cache/
git rm --cached db_changes.docx
Then I committed the repo. But if I run git status
again, those files still show up in the "untracked files" list.
I ran:
git ls-files . --ignored --exclude-standard --others
to list .gitignore files, but nothing showed up. I'm sure I put them in the .gitignore file correctly, so I'm really confused/frustrated.
Upvotes: 5
Views: 3808
Reputation: 2777
My .gitignore
file was in the wrong place. I had it in the root of my .git
directory, not the root of my repo.
Upvotes: 5