3 ms·
If you want to go the mentioned "rewrite-whole-history" route, I have used BFG Repo Cleaner [0] successfully in the past. It's way faster than git-filter-branch
by leipert 8y ago
If you want to go the mentioned "rewrite-whole-history" route, I have used BFG Repo Cleaner [0] successfully in the past. It's way faster than git-filter-branch [1].
Another thing: You can work with shallow clones. If the commit is ancient, no need to pull the whole history of a project.
[0]: https://rtyley.github.io/bfg-repo-cleaner/ https://rtyley.github.io/bfg-repo-cleaner/
[1]: https://git-scm.com/docs/git-filter-branch https://git-scm.com/docs/git-filter-branch
- hprotagonist 8y agosame. one of the most useful java programs i have!
- tjoff 8y ago> If the commit is ancient, no need to pull the whole history of a project. Can you query the server logs somehow? Just because you don't want a complete local copy you would of course still want to be able to query the log and request diffs from any commit.
- Carpetsmoker 8y agoI tried to use BFG to clean a repo of excessive large files once. After the `git push --force` our entire repo was gone. Oops! Use with care, do it on a Sunday (or other time most devs aren't working), and be prepared to restore a backup.
- philliphaydon 8y agoI used this to shrink a 4gb repo with 4 years of history to about ~50mb. Works great. After I figure out how to use it.
- gbacon 8y ago[ Addendum 20181009: A lot of people have unfortunately missed the point of this article, and have suggested that I use BFG or reposurgeon. I have a small problem and a large problem. The small problem is how to remove some files from the repository. This is straightforward, and the tools mentioned will help with it. But because of the way Git works, the result is effectively a new repository. The tools will not help with the much larger problem I would have then: How to get 350 developers to migrate to the new repository at the same time. The approach I investigated in this article was an attempt to work around this second, much larger problem. ]