You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
Hello,
We are about to migrate to Bitbucket from GitLab. In some preliminary tests, we noticed a large difference in repository storage size when importing a project to Bitbucket from GitLab (using Bitbucket's import functionality). As an example, a 640 MB repository becomes 192 MB on Bitbucket. Everything is imported correctly, and the history seems intact. This drastic size difference remains however a bit mysterious. We would like to make sure that really nothing is lost in the process.
I would be happy to understand more rigorously the reason of this change, and would gladly take any input / advice on how to debug this.
Best regards,
p.s. we are not using Git LFS
Hi @Michael Ligotino and welcome to the community!
When you import a repo, all the branches and history of the .git repo will be imported (the only exception is Git LFS objects, that you are not using).
One possible reason for this discrepancy may be inaccessible commits in the GitLab repo. If you do any of the following:
then certain commits will become inaccessible. These inaccessible commits remain in the remote repo unless a garbage collection runs (git gc). When a git gc runs for a repo, it can run with different parameters that determine which inaccessible objects will be deleted.
A git gc also compresses file revisions and there are parameters that control the depth of compression.
So, the size of the repo in GitLab depends on when the last garbage collection ran for that repo and with what arguments.
When you import a repo these unreachable objects will not be imported.
You can try taking a bare clone of the GitLab repo on your machine, with the command
git clone --bare <gitlab_repo_url>
Then navigate to the directory of the bare clone, and run the command
git count-objects -Hv
The sum of the fields size and size-pack in the output will show you the size of the bare clone.
Kind regards,
Theodora
Dear Theodora,
Thank you so much for your answer. This will definitely help me understand more what is going on.
Kind regards,
Michael
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You are very welcome, Michael. Please feel free to reach out if you ever need anything else!
Kind regards,
Theodora
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.