GitHub Desktop is committing ignored files

Derek picture Derek · Apr 13, 2017 · Viewed 15.7k times · Source

My GitHub Desktop app is trying to commit a bunch of files that are (supposedly) ignored.

GitHub Desktop Screenshot

As you can see, the entire .metadata folder is listed in my top-level .gitignore file. Still, there are loads of files from that folder that are being committed each time. Am I missing something about where the file needs to be placed?

EDIT: I should add, please do not just tell me to use the command line.

Answer

djreisch picture djreisch · Apr 13, 2017

Most often the case is that if the files existed before they were added to the .gitignore file, they will not be ignored in any following commits or pushes.

My suggestions for you, since you don't want to use the command line, is cut the files/directories from your git directory, perform a commit, and then push. After the push finished, you can paste the offending files/directories back into the git repo and they should now be ignored.

Just in case you wanted to know, you can use the git bash git rm -r --cached some-directory and then perform a commit and push and you will have achieved the same result.