I have a Git repository which is around 2.2GB at the moment. It was originally created to hold a WordPress website and after a large redesign it now houses a much smaller HTML static site.
Because the repository still holds all of the references to the previous WordPress site, it is much larger than it needs to be which is causing some size limit issues with the provider we use.
The repository is distributed, that is there are local cloned versions of it on more than one development machine, and Git is used to integrate changes across the staging and production servers the site runs on. There is a master branch and then one branch each for staging and production changes.
I do have access or at least know where all cloned instances of the repository are so I can run updates on each of them if required.
What I'd like to do is remove the references to the earlier WordPress commits and effectively restart the repository from the redesign point.
I have searched on StackOverflow and across the web but due to the fact any actions of this nature modify the Git history, there have always been warnings against running commands like git rebase
.
What would be the best way of fixing this and reducing the repository size?