Somebody accidentally checked in 80 megs worth of JPG's into our git repository and pushed it to github central repository.
A few people since pulled these changes.
Apart from shooting the committer, what can I do to remove these images completely from the repository's history and github? And then inflict all changes on other committers.
You need to fix the changes with git reset sha_of_last_good_commit than push those backup up with git push -f. You will than need to tell everyone to pull the new changes back down.
If there are changes that you want to keep intermingled with the bad commits, you will need to git rebase -i to pluck out the ones you don't want before you push your fixed repo back up to github.
Garbage collection will eventually remove the dangling objects, or you can force it with git gc --aggressive
A more radical approach is using filter-branch.
git filter-branch --tree-filter 'rm -f *.jpg' HEAD
However you should be VERY careful when using this, as you can really mess up your repo. You should check the docs before doing anything.
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