bcgov / von-network

A portable development level Indy Node network.
Apache License 2.0
163 stars 188 forks source link

BFG cleaner suggestion - [Change to existing git refs] #292

Closed ff137 closed 8 months ago

ff137 commented 9 months ago

I noticed when downloading my fork, the repo is ~60MB big. It's coming from the .git/object directory, so represent a big file that was previously committed and then deleted. This remains in the git history and makes cloning the repo slow (for us with slow internet, and workflows doing checkouts etc).

The problem file: sst_dump.tar.gz

The solution: BFG repo cleaner


Requirements: maintainer/admin access with force push permissions.

Warning: Following steps below will edit the git history to completely remove the single large object from git references. If you want to keep that file, don't follow these steps! If you're not sure, make a backup! A backup allows git history changes to be reverted.

Benefit: improves overall efficiency of working with the repository

Cost: Contributors will have to re-synchronize these git history changes by hard resetting their fork (git reset --hard upstream/main; git push -f)


Ta-da 🎉 the 60MB object is now removed from the git history. Repo is now 1.6 MB

Very minor quality of life improvement, and maybe it's more trouble than it's worth, but still thought it's worth sharing! This tool is very helpful for removing large files, and removing passwords files or sensitive keys that have previously been committed and exist in the git history,

It's not possible to make such changes via PR - needs to be force pushed by admin directly. You're welcome to ignore this suggestion, but this is just what I'd do if I was admin ☺️

WadeBarnes commented 9 months ago

@ff137, Thanks for the info!

WadeBarnes commented 8 months ago

This has been done. Note to anyone encountering issues syncing with the repo. You will need to reset your main branch to match the new commit history. The other option is to delete your working copy and re-clone.