You can remove tracked files from vcs manually using the Terminal tab in the Android Studio or Git Bash console.
To ignore ignored files, you must:
1) Make sure the files you want to ignore are correctly specified in .gitignore
2) Commit pending changes (important!)
3) Run the commands
git rm -r --cached . git add .
4) And then lock again:
git commit -am "Remove ignored files"
These steps remove all elements from the Git Index and then update it, but Git is ignored.
The reason for making the pending changes in step 2 is that if rm is part of another commit, it does not work properly.
Read more in the comments here .
Artem m
source share