There's a self hosted git repository on a Windows Server (Bonobo based if anyone interested). The repository got bloated up because of binary blobs and I'd like to strip out these large blobs along with their whole history.
I was looked at bfg / git filter-branch, bfg-ish, and git filter-repo. My question I think is invariant of these however it sounds like git filter-repo is the most advised.
The big question: should I execute the --strip-blobs-bigger-than 4M on the repository clone (working copy), or should I go straight ahead and manipulate the hosted bare repo what the Bobono manages? If I execute it on the client clone than how will the changes propagate into Bonobo? These changes will be pretty fundamental, will they be even committable?
I already backed up everything, did some filter-repo analysis. I included the blobs in gitignore (although their modification still show as a change).
I ended up operating on the hosted bare repository. It looks like filter-repo is intended to be used on a clean clone of a repository:
So I retried on a clean clone and the instruction ran, but then I was clueless what to do next. There were no file changes per se to commit or push, the "meta data" was modified. The operation also interestingly stripped
[remote "origin"]and[branch "master"]from the.git/configso I needed to re-establish remote and branch.So I decided to just go ahead and modify the hosted bare repo. The tool recognizes that it is not a clean clone:
With forcing the meta data size decreased from 1.3GB to 150MB, similarly as it was executed on the clean clone meta data.
This happens to be a Windows environment, I started off of a clean clone after that, and I had to re-trust the repository in Visual Studio and all that. So far I could push some changes and I'll report back if anything seems to not work.
It's another story if you are dealing with a repository managed by GitHub or other git services, in this case you won't have direct access to the bare repository they manage. Not sure what happens in that case. I guess you can push the meta data change somehow? Someone should comment.