If a file "a.txt" has been committed and pushed to a GitHub repo but I want to ignore it now.
Using git bash, I could use git rm --cached a.txt and a new line "a.txt" in .gitignore to delete this file in the GitHub repo.
But what should I do if I use Eclipse ?
Eclipse allows you to mark files as
Untrackedby right-clicking on the file and selectingTeam>Advanced>Untrackeven if that file is present in the.gitignore.:This will essentially do the same as
git rm --cached.Then, the file will be marked as deleted in the
Staged Changespart of theGit Stagingmenu:After doing that, just commit and push the (staged) changes.
Of course, nothing stops you from using the command-line. Even if you use Eclipse, you can still enter some commands via the command-line and do some other stuff with Eclipse/EGit.