Following command edits the bare repo (rather than a clone of the repo)
cd bare_git_repo
git filter-branch --prune-empty -d /Users/username/software/git_test/git_backup --index-filter "git rm --cached -f --ignore-unmatch a_large_binary" --tag-name-filter cat -- --all
Then run the following on the bare repo
git update-ref -d refs/original/refs/heads/master
git reflog expire --expire=now --all
git gc --prune=now
Now that the bare repo is cleaned, users should discard old clone and get a new clone
cd cloned_git_repo
rm -rf bare_git_repo/
git clone file:///Users/username/software/git_test/bare_git_repo/
cd bare_git_repo/
Verify in the cloned version the file is actually gone:
git log --graph --decorate --pretty=oneline --abbrev-commit --all --name-status
To find large files in the cloned repo, the command
is from https://gist.github.com/rtyley/4202730