I have an android project that has a test module that will remove and recreate .apk files in a subdirectory in the git directory.
I have added these to .gitignore (the directory, the files explicitly, and *.apk ) and then I have done
git rm -r --cached src/main/Tests/bin
and git tells me:
rm 'src/main/Tests/bin/Tests-debug-unaligned.apk'
rm 'src/main/Tests/bin/Tests-debug.apk'
rm 'src/main/Tests/bin/Tests.ap_'
rm 'src/main/Tests/bin/classes.dex'
i then
git commit . -m "removed apk files"
I run the tests again which delete the files and the recreate them. I run git status and they show up as modified. It seems .gitignore is not working. Here is my .gitignore file
*ipr
*iml
*iws
.gitignore
out/
*apk
src/main/Tests/bin
src/main/Tests/bin/*
src/main/Tests/bin/Tests-debug-unaligned.apk
I just tried your recipe and it worked for me.
Perhaps the gitconfig in some other directory (or a global directive) that's overriding what you have in the gitconfig you have stated. You did not mention where this gitconfig is located. See the man page for gitignore or the online help docs for the precedence of the various locations where you can specify ignore rules. The man pages say...
have you tried just
in your .gitignore? If they were tracked before, you will need to delete them and commit that before setting the .gitignore. Once they are out, add the entry in the .gitignore file and it should work.
I think you need to clean all your stagged files using:
Then commit:
But make sure you commit your changes before doing this.