Reputation: 645
I had a lot of files autogenerated by Android studio after I build the project, so when I try to commit
the project, the commit section is full of files I didn't want to commit
or push
to the repo.
How I can tell Git
to don't care about these files and didn't commit or push them?
I try to add the packages dir in the .gitignor
file, but it seems nothing happens.
Upvotes: 2
Views: 670
Reputation: 1327364
While a git rm --cached -r -- *.dex
should be enough, don't forget it will only delete those files from the current commit.
If they are big, and should never have been committed, you would need to remove them from the full history of commits (assuming you are the only one working on this repository, or assuming you can warn your colleague about the impending git push --force
)
Using newren/git-filter-repo
cd repo
git filter-repo --path-glob '*.dex' --invert-paths
Again, if those files are small, and with a limited history, a simple git rm --cached
is enough.
Upvotes: 1