Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,555,443
Community Members
 
Community Events
184
Community Groups

Considerable change in repository size when importing

Michael Ligotino
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
Mar 20, 2023

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

1 answer

1 accepted

0 votes
Answer accepted
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Mar 21, 2023

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:

  • create a branch, add commits to it, push it, and then delete the branch without merging it
  • alter history and push it to the remote repo (e.g. with commands like git reset or git rebase)

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

Michael Ligotino
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
Mar 22, 2023

Dear Theodora,

Thank you so much for your answer. This will definitely help me understand more what is going on.

Kind regards,

Michael

Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Mar 22, 2023

You are very welcome, Michael. Please feel free to reach out if you ever need anything else!

Kind regards,
Theodora

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events