Request for Guidance on Deleting Specific Commits Due to Repository Size Limitation

NTTD _袁梦
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!
February 11, 2025

We are seeking assistance with an issue regarding one of our repositories. The repository has exceeded the 4.0 GB size limit and we are unable to push merges or updates.

To restore functionality, we would like to remove two specific commits.

Can you please tell us how to safely remove the merged commits and resolve the repository size issue?

We look forward to your prompt response.

1 answer

0 votes
Phil C
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 13, 2025

Hello,

Welcome to the community!

As you may know, removing commits from a Git repository is not straightforward. It requires rewriting history, which means altering the repository's commit history.

Here are some steps you can use as reference:

1. Backup:

2. Using Tools:

  • A popular tool to help with this cleanup process is the - BFG Repo-Cleaner, which is an alternative to 'git-filter-branch' for removing bad data from your Git repository history. For detailed information, please review our documentation - Maintain a Git repository

3. Collaboration Impact:

  • After rewriting the history, the updated repository would need to be force-pushed to the Bitbucket Cloud. This action requires that all collaborators sync their local repositories by recloning the remote repository.

4. Communication:

  • It's important to communicate these changes to all team members to ensure a smooth transition and avoid potential workflow disruptions.
  • After completing the process, you can submit a ticket to Bitbucket Cloud support if you're on a paid plan, requesting garbage collection. If you are not subscribed to a paid plan, automatic garbage collection will periodically run to optimize the repository by cleaning up unnecessary files and conserving space.

Cheers,
Phil C.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events