Al Phaba Al Phaba - 1 year ago 111
Git Question

How to remove generated files in Git repo?

I created a git repo and worked a bit on my android projekt, but now I recognize that I added files into the repo which will change each time because they are generated. How can I remove them and be sure that wont be added again.

I have already added them to the .gitignore which locks like this


But now I am not certain how to delete it from the repo so that it wont be under version control.

This is my git status log

$ git status
# On branch master
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
# modified: bin/PDiXUploader.apk
# modified: bin/classes.dex
# modified: bin/resources.ap_
# modified: gen/de/srs/android/pdixuploader/
# modified: res/layout/activity_instance_selection.xml
# modified: res/layout/activity_main.xml
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
# res/values/dimens.xml
no changes added to commit (use "git add" and/or "git commit -a")


Answer Source
git rm <file>

Should remove the file from the repo for you.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download