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,458,175
Community Members
 
Community Events
176
Community Groups

Repository is over the size limit (4 GB) and will not accept further additions.

Edited

remote: Learn how to reduce your repository size: https://support.atlassian.com/bitbucket-cloud/docs/reduce-repository-size/#Rewind-history-to-undo-large-commits.
To https://bitbucket.org/workspace-id/repo.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://bitbucket.org/....git'

I can not push due to reaching the sit limit of the repo.

How can I delete the big files/folders and push the commit, or i want to add folders to gitignore so I can skip them and free up space, is it possible?

 

More details: 

count: 4875
size: 1018.52 MiB
in-pack: 10075
packs: 3
size-pack: 3.65 GiB
prune-packable: 4808
garbage: 0
size-garbage: 0 bytes

1 answer

0 votes

Hi Rafael,

I ran a git gc for this repo and its size has been reduced to 2.1 GB.

You and your team should be able to push now. However, I would advise reducing the repo's size further, if possible.

You can check this post of mine in a different question with more details:

If you decide to proceed with the steps mentioned in that post and rewrite history in the repo with BFG, please keep in mind that the repo's size will get increased again once you push your changes. The repo will then need another git gc for the old commits (prior to history rewrite) to get removed and to get its size reduced. You can let me know here, and I can run another git gc for the repo.

We have a feature request for allowing users to trigger a git gc for their remote repos that you can vote for and add yourself as a watcher:

Just a heads up, I removed the workspace-id and repo name from your post to protect your privacy.

Kind regards,
Theodora

Good afternoon, what happened was that we have a folder which contains too many static files which we now want to include in the .gitignore and push again.

That way there would be no problem? Or will it go back to the previous size? Please tell me to proceed in this way.

Hi @Rafael Berrospi,

The repo size may go up if you rewrite history and push to Bitbucket. This is because the remote repo will contain both old and new references, and it will need another git gc. I can run it if you let me know after you push, and then the repo's size should get reduced (provided that you pushed a repo of a smaller size).

Please see the following two options I explain below, and take a backup of the repo (a clone with the --mirror flag) before you push any changes so that you can recover the repo if anything goes wrong.

Option 1

If that folder is committed to a branch named e.g. feature, and
- you haven't added more commits to this branch (so, the commit with the large folder is the last one on this feature branch) and
- you haven't merged this branch into any other branches

then you can:

  1. Checkout this branch locally
  2. Reset the last commit with
    git reset --soft HEAD~1
  3. Push that branch to Bitbucket with
    git push --force

Option 2

If the conditions I listed in Option 1 are not met, it's best to rewrite history with BFG. BFG has an option --delete-folders that can be used to remove a folder from the repo's history. You can check more details here:

Kind regards,
Theodora

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS

Atlassian Community Events