I have a GitHub repo that had two branches - master & release.
The release branch contained binary distribution files that were contributing to a very large repo
... and without further ado, may I present to you this useful command, "git-gc-all", guaranteed to remove all your git garbage until they might come up extra config variables:
git -c gc.reflogExpire=0 -c gc.reflogExpireUnreachable=0 -c gc.rerereresolved=0 -c gc.rerereunresolved=0 -c gc.pruneExpire=now gc
You might also need to run something like these first, oh dear, git is complicated!!
git remote rm origin
rm -rf .git/refs/original/ .git/refs/remotes/ .git/*_HEAD .git/logs/
git for-each-ref --format="%(refname)" refs/original/ | xargs -n1 --no-run-if-empty git update-ref -d
You might also need to remove some tags, thanks Zitrax:
git tag | xargs git tag -d
I put all this in a script: git-gc-all-ferocious.