.gitignore file got cached
I have problems with my .gitignore file not ignoring directory that I set in it.
on my mac I run:
git statusIt show long list of files in .idea directory
new file: .idea/[file name]
git config core.excludesfileand It shows me the correct .gitignore file.
I also been trying to run:
git rm . -r --cached .
This is my .gitignore file:
Any idea what else can I do. I need to perform a commit and I do not want to commit everything.
One Solution collect form web for “.gitignore file got cached”
In fact you already added those files to git (they are tracked, that’s why git says “new file”. otherwise git would say: “untracked files”.. this does not mean they are committed, but ready to be committed). To untrack them:
git reset HEAD <file>
I think the easiest thing for you to is to untrack all files:
git reset HEAD .
then add only the files that you will track.
more info .gitignore works only for files that are not tracked!