I have a Bitbucket Git Cloud repo that is reaching the 1Gb soft limit. There are not really big files in there (the larger is 20Mb and the following one is 5Mb, and those are not much). So I think that the size of the repo is coming from the history, as we have lot's of files that are changing frequently (some of the files may be changing more than 20 times in a day) since 2015 when we started with this repo.
Is there a way that I can compact the history of the repo to keep for example only the history up to last year? Will this help in reducing the size of it? What are the side effects of it? What is the negative side of doing it?
Can I keep the actual history (before compacted) in a separate repo so that if for some reason we need to dig to commits earlier than last year we still have a way?
Thanks in advance.
Hey Francisco, you can squash older commits to reduce the size of your repository and clean up the history. You can see the section Squash commits for a clean history for details on that.
Hey Francisco,
You should be able to clean up the history of master with something like rebase -i. There is a good article on that in 15 Seconds to Cleaner Git History.
You must be very careful when doing so. Please head their and our warning:
"Rebase is neat, but it’s dangerous, because it rewrites commit history. If you rebase history that is already living upstream or on other developer’s machines, you’re headed into a world of pain.
Plain and simple, do not rebase commits that you’ve already pushed (unless you are the sole developer–in that case, rebase at will and use git push -f
)."
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks @Ben Stuart then this doesn't work for us, as we have more than 50 developers and they all have living branches that were created out of master.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.