I've got a git repo with three years worth of PowerBuilder binary files. The repo is pretty huge (just under 10GB), I assume due to the fact that git can only do so much for binary deltas.
I'd like to get this repo to a manageable size, and I'm willing to throw away a bunch of early history to do it. I just can't figure out how to get git to do it. I tried squashing commits with interactive rebase, but it comes up with a bunch of conflicts I don't want to deal with.
Is there a way to pick a commit, and just throw away everything before that? I realize it will rewrite the SHA-1 for subsequent commits, which is no problem.
This is one (other) way:
git fast-export master~5..master | (cd ../newrepo.git && git init . && git fast-import && git checkout)
The above example will take commits in range master~5..master
and create new repo out of that. You can use the same repo too, but the above will be safer.
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