Lesstep
Bitbucket Cloud · git push · Checked October 28, 2026

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

The repository on Bitbucket Cloud is over 4 GB, so Bitbucket takes only pushes that undo the latest commits. Your new commits did not reach Bitbucket. Undo the push that took the repository over the limit, then push your work again without the large files.

The whole message

As Atlassian's article Reduce repository size shows it:

remote: Repository is over the size limit (4 GB) and will not accept further additions.
remote:
remote: Learn how to reduce your repository size: https://confluence.atlassian.com/x/xgMvEw.
 ! [remote rejected] main -> main (pre-receive hook declined)
error: failed to push some refs to 'https://bitbucket.org/<workspace>/<repository>.git'

The push that took the repository past 4 GB went through. The message comes on the next push.

Which limit is it?

Undo the last push, and keep your work

# 1. Keep your local commits on a temporary branch
git branch keeper

# 2. Go back to just before the last commit Bitbucket took
git reset --soft @{u}^

# 3. Push that, rewriting the branch on Bitbucket
git push --force

# 4. Bring your local commits back
git merge --ff-only keeper
git branch -d keeper

These are the commands from Atlassian's article. We ran them against a local git server that takes only pushes that rewind a branch, as Bitbucket does over the limit. Its refusal read like the message above. After step 3 the server's branch ended one commit before the large one. After step 4 the local branch was back where it was, large file included, two commits ahead of the server.

Bitbucket then runs garbage collection by itself, and pushes work again. If the repository is still large after you remove the large files, Bitbucket collects again when it is over 75% of the limit; if that does not help, ask Atlassian Support to run it.

Push your work again, without the large file

Do not push yet: your local branch still has the large file in its history. If it is only in commits Bitbucket does not have, fold them into one commit without it:

git reset --soft @{u}
git rm --cached path/to/large-file
echo "path/to/large-file" >> .gitignore
git add .gitignore
git commit -m "Your message"
git push

On the same local server, with the limit lifted, this pushed one commit without the large file, and the file stayed on disk. If large files are older and already on Bitbucket, you need to rewrite the history: see Atlassian's Maintain a Git repository and Use BFG to migrate a repo to Git LFS. Afterwards everyone makes a new clone; an old clone that is force pushed brings the large files back.

Create Bitbucket pull requests from IntelliJ IDEA

Pull Request Inbox for Bitbucket, a plugin by Lesstep for JetBrains IDEs 2024.1 or later, adds Git → Create Bitbucket Pull Request… for Bitbucket Cloud and Data Center. It opens a pull request from the branch you are on, into the repository's main branch unless you pick another. If the branch is not on Bitbucket yet, it says so and opens the IDE's push dialog first. Creating, approving and merging pull requests are Pro (US$1.50 a month, with a 30-day trial); the review inbox is free.

Get it on JetBrains Marketplace

Bitbucket and Atlassian are trademarks of Atlassian; IntelliJ IDEA is a trademark of JetBrains s.r.o. This page is not affiliated with or endorsed by Atlassian or JetBrains.

More: "Your push failed because the account has exceeded its user limit" · "pre-receive hook declined" for branch restrictions · Bitbucket pull request plugins for IntelliJ IDEA, compared · "Your LFS push failed because your account is out of file storage" · 日本語