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,457,445
Community Members
 
Community Events
176
Community Groups

Dear Bitbucket support team,

 

We have a repo that has over 2 GB (thus the warning). 

I wasn't quite 100% sure on the sequence of git commands to run to first delete select large files and clean the history. I was able to clean it following the instructions below and removed large CSV files from my repo delete_history_test. The repo is still 66MB and should be much smaller. Can you run the GC on that repo, so I have proof that these instructions work? After which I'll talk to my team to clean up our repo and I suppose we will need to trigger a GC next week. 

Dummy Exercise:

What I wanted to have is 

  • main branch with checked-in large files.
  • infected branch with still work to do (but everything committed and pushed to remote)

The large files exist in both the main and the infected branches, so I did:

  • git checkout main
  • git rm large_file.csv
  • git commit -m "delete large file"
  • git push
  • git checkout infected branch
  • git rm large_file.csv
  • git commit -m "delete large file"
  • git push

Then, I clean the history doing:

  • git checkout main
  • git filter-branch -f --prune-empty --index-filter "git rm --cached -f --ignore-unmatch large_file.csv" --

  • git push -f
  • git checkout infected branch
  • git filter-branch -f --prune-empty --index-filter "git rm --cached -f --ignore-unmatch large_file.csv" --
  • git push -f

I suspect after this point, all of the histories should be clean and I need to trigger the GC from the remote which I can't trigger. 

Can you trigger it to this repo delete_history_test so I can make sure it works?

 

Thanks,

Justin

1 answer

0 votes

Hi Justin,

I ran a git gc for this repo and its size is 58.6 MB now.

Can you take a mirror clone of the repo and execute git count-objects -Hv in the mirror clone directory, and let me know what you see in the output?

Kind regards,
Theodora

Hi Theodora, here's my output from that command:

output_command.PNG

How come the repo is still 58MB ? There is barely anything in the repo?

Hi @justin.charbonneau,

In your first post, you mentioned that the repo has more than one branch.

1. Does your clone (where you executed git count-objects -Hv) have all branches locally?

If you haven't pulled all remote branches locally, then the local repo will be of a smaller size.

2. Could you please take a mirror clone of the repo delete_history_test

git clone --mirror <repo_url>

and then run git count-objects -Hv in that mirror clone, and let me know what the output is?

Kind regards,
Theodora

Hi @Theodora Boudale

Initially yes it had more than one branch. In the meantime I had discovered that maybe I could use LFS to move those files there, and I tried to play around with it. At one point in time, the repo went down to 60 KB when I had first created another branch and installed LFS and added the gitattributes for CSV files, but after merging it, the repo went back to 66MB. I tried to reproduce but I couldn't. In the end I deleted the LFS file and tried to clean it up to bring it back to that initial state. 

Here's a screenshot of the commands you told me to run:

screenshot bitbucket.PNG


 

Hi @justin.charbonneau,

Thank you for the info.

Since the mirror clone also shows a size of 8.96 KB, we will need to inspect the remote repo to see what takes up extra space.

I cannot access your repo in order to check that, we need a support ticket in order to be able to access a remote repo.


I see that the test repo delete_history_test belongs to your personal workspace, but there is no other repo there over 2 GB.
I also see that you are a member of a workspace on a paid billing plan.
Does the repo that has a size of over 2 GB belong to that workspace?

If so, what you can do is:

  • talk with your admins and transfer delete_history_test repo to the workspace on the paid billing plan
  • you can then create a ticket with the support team to look into the issue with the size. You can create a ticket via https://support.atlassian.com/contact/#/, in "What can we help you with?" select "Technical issues and bugs", then Bitbucket Cloud as product, and enter the workspace URL of the paid billing plan.

However, if delete_history_test repo is not related to a repo on that paid workspace and it's your personal repository, please feel free to let me know and I can create the support ticket for you.

Kind regards,
Theodora

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events