What do you mean by "don't seem to work"? It's hard to help without any specifics.
The thing that jumps out to me as most likely is that those instructions use HEAD
for the ref to filter, so it'll only filter commits reachable from whatever you have checked out right now. You probably want to do this to all branches; instead of git filter-branch ... HEAD
you could use git filter-branch ... -- --all
. The --
indicates end of filter-branch options, and the --all
means to filter all refs.
The best general advice I can give is to read the filter-branch man page. It contains some examples as well.
Finally, remember that the old objects stay around in the repo. Debilski touched on this, mentioning that you have to prune the old objects (git gc --prune=now
) or reclone the repo to see the size difference. This will work fine for you locally.
To get it cleaned on the remote... well, I believe that github will eventually run git gc
, but it'll be using the default prune settings, so they won't be pruned for a couple weeks. Otherwise, you could delete and recreate your project. I'm not aware of any way to force a gc on github.