I am using Eclipse for local dev and GitHub as my remote git repo. Eclipse generates several artifacts that I don't want in my remote repo, but I forgot to add those to my .gitignore
file. I pushed everything to the remote GitHub repo and realized that the following items were pushed (again, unintentionally):
myapp/
<lots of other stuff>
.classpath --> undesired
.settings --> undesired
.project --> undesired
bin/ --> undesired
So I went back and added the following to my .gitignore
:
# Eclipse
.classpath
.project
.settings
bin/
I then committed & pushed. To my surprise, the files are still in my remote repo. I would have expected the following behavior:
- I push the
.gitignore
changes to GitHub - GitHub sees that there are files in its
myapp
repo that violate the terms of the new.gitignore
- GitHub deletes these files/directories from the repo
- Now when I go to
myapp
on GitHub, I don't see them anymore
Is this not the case? What's the fix here?