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
bin/classes/**
gen/**
bin/PDiXUploader.apk
bin/classes.dex
bin/resources.ap_
gen/de/srs/android/pdixuploader/R.java
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/R.java
# 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")
Thanks
Since you only want to remove it from the repository, not from your filesystem, you'll want to use:
git rm --cached <file>
That will remove the file from the index, so it won't be in the next commit, but will leave the file on disk.
git rm <file>
Should remove the file from the repo for you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With