What are the repository and file size limits?

Still need help?

The Atlassian Community is here for you.

Ask the community

We enforce the following limits to prevent Bitbucket Cloud use in a way that consumes a disproportionate amount of system resources or that would adversely impact the performance or operation of Bitbucket Cloud for other users. In addition to the enforced limits, this page contains some general "good neighbor" suggestions for using Bitbucket.

Repository size

  • Over 4 GB limit: Your ability to push new commits to the repository will be disabled. You will be notified via a notification bar in Bitbucket Cloud.

See the following table for more information about repository size and other system limits. To find the size of your repository, see Finding your repository size.

See the following table for more information about repository size and other system limits. To find the size of your repository, see Finding your repository size.

Limit type

Size or number of occurrences

Reason

Repository size: the total size of your repository on Bitbucket.


2 GB limit

When your repository reaches 2 GB or beyond, we will send you a message to let you know you are over halfway to the 4 GB repository size limit. If you need to keep large files in Bitbucket, consider introducing Git Large File Storage (Git LFS) as part of your workflow, and Use BFG to migrate a repo to Git LFS.


If your repository is larger than 2 GB, you should consider if you are using Bitbucket correctly. Keep in mind Bitbucket is a code hosting service, not a file sharing service. We offer some suggestions for binaries below. 

For more information about managing your repository size, see Reduce repository size.

 4 GB limit - Bitbucket Cloud’s default repository size limit

Your ability to push new commits to the repository will be disabled.

Learn more about reducing repository size.

Customers with Premium accounts that require a larger repository than our default 4GB size can contact our Support team.

Git repositories are inefficient at these sizes, so the performance you experience locally will be degraded while consuming more resources on our systems.

File requests: the number of times a file is actively downloaded

This is not a limit on actions such as:

  • Pushing or pulling commits

  • Running a fetch command to get recent changes

  • Pushing or pulling a branch (unless that branch contains more than 1000 new files)

5000 requests per hour

This is to prevent the use of Bitbucket as a content delivery network (CDN) which would consume a disproportionate amount of resources. Amazon's CloudFront is a better choice for simply hosting your compiled project binaries.

Downloading archive .zip files

These archive files are accessed from the Downloads page.

Must be no larger than 2 GB

Creating and downloading archive files over 2 GB consumes huge amounts of processing and bandwidth. For these types of requests, we recommend taking a copy of your archive locally or using a CDN if you need to widely distribute a file.

Uploading files

Must be no larger than 1 GB.


Push limit

Must be no larger than 3.5 GB per push.

Bitbucket Cloud has a push limit of 3.5 GB per push, if a push of a pack that exceeds this limit is attempted, it will be prevented and return the following error:

remote: fatal: pack exceeds maximum allowed size
remote: Guidelines: https://support.atlassian.com/bitbucket-cloud/docs/reduce-repository-size/#Avoiding-large-commits
error: remote unpack failed: unpack-objects abnormal exit

Finding your repository size

To check the relative size of your repository in Bitbucket select Settings, which should open the Repository details page, then look for the Size line.

repository settings page with 3 callouts defined below the image

  1. Repository details: Find the repository size on this page.

  2. Settings: Notice this link in the left panel.

  3. Size: Each repository includes a size under its name on this page.

Git Repository Size from the Command Line

For Git, you can use the git count-objects -v command:

$ git count-objects -v
count: 0
size: 0
in-pack: 478
packs: 1
size-pack: 92
prune-packable: 0
garbage: 0

The size-pack value is the size of your repository when it is pushed to a remote server like Bitbucket. The size-pack value is shown in kilobytes. So, in the above example, the repository is not even 1 MB.  

(info) Note that the size of the local repository may differ from the remote repository because on the server-side copy of the repository we host is sometimes necessary for us to preserve objects that aren’t part of a clone—even a full mirror clone. The reason for this is to be able to continue to perform diffs on pull requests that have been closed either by merging or declining. This property was a part of a recent change to improve the performance of complex diffs. 

Have a lot of binaries such as images or sounds?

Keep in mind Bitbucket Cloud is a code hosting service not a file-sharing service. If a lot of your files are extremely large or if your files are binaries or executables, you should understand Git will not work well with them. You'll find that even locally your repository is barely usable.

For binary or executable storage, we recommend you look into file hosting services such as DropBox, rsync, rsnapshot, rdiff-backup, and so forth.  Still not sure what to do? Review this post on stack overflow for more ideas.

Last modified on Nov 1, 2022

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.