This topic describes Git repository capacity limits, cleanup procedures, and how to manage and clean up large binary files.
Git repository storage capacity limits
An organization can have unlimited Git repositories. By default, each one includes 20 GiB of space, which includes 20 GiB of Git capacity and flexible Git LFS space. Individual repositories do not have a specific LFS limit but are subject to the organization's total capacity. You can purchase additional storage on a pay-as-you-go basis.
-
What is Git LFS storage capacity? For more information, see Introduction to the Codeup Git LFS feature.
-
For more information about pay-as-you-go, see Pay-as-you-go billing rules.
Clean up Git repository capacity
To ensure platform stability, we recommend keeping each Git repository under 5 GB. Use Git LFS to manage large binary files.
When a Git repository nears its storage threshold, clean up the repository. Migrating binary files to Git LFS is highly recommended to improve push and pull speeds. This migration does not affect your daily workflow.
Before you reach the capacity limit
When storage usage reaches 90% of the limit, the platform sends a notification when you push to the repository. Developers should promptly clean up the repository. Once the storage limit is exceeded, write operations are disabled, and you will not be able to delete files to free up space:
File cleanup: Promptly delete unnecessary files to free up repository space.
Garbage collection (GC): When the repository nears its storage limit, an administrator can run garbage collection (GC). Go to and use the GC feature to compress repository objects, reduce disk usage, and improve read and write efficiency.
LFS space cleanup: When you use Git LFS to manage binary files, deleting the Git source file does not automatically delete the corresponding LFS asset file. To clean up these LFS files, go to , select the files you want to delete, and then delete them.
Use the following command to list all tracked Git LFS files. You can then use this list to identify and delete any unneeded LFS assets.
git lfs ls-files
When the capacity limit is reached
When the recommended capacity limit is reached, the platform temporarily locks write permissions for the Git repository. At this point, the only available operation is to run a garbage collection (GC) optimization in the repository settings.
A warning banner appears at the top of the repository homepage, directing you to Settings > storage management to optimize storage, or to contact technical support to request a capacity increase.
A blue banner at the top of the page displays the current plan version (such as Alibaba Cloud DevOps Basic Edition). This section lists details about available users, basic features, and resource capacity, including single repository capacity, maximum concurrent pipeline tasks and runtime, and artifact repository capacity. To upgrade, click the Purchase Advanced Edition button.
Clean up large files from Git history
Committing large binary files to a Git repository can cause it to exceed the capacity limit and block write operations. A single large file can also be rejected if it exceeds the individual file size limit.
In this situation, we recommend cleaning up large files from the repository's commit history and then using Git LFS to manage them. For instructions on migrating existing files to Git LFS, see the LFS Migration Guide.
Back up your data
This cleanup process rewrites the commit history of the Git repository, which is a destructive action. Before you proceed, clone the remote repository to create a local backup.
Install the required tool
Cleaning up large files requires rewriting the repository's commit history. The git-filter-repo tool is recommended by the official Git community for this purpose. This topic explains how to use the git-filter-repo tool to clean up large files from your repository.
install it directly by using the following command:
pip3 install git-filter-repo
Clone a bare repository
From Codeup, clone a bare repository of the target repository. The following example uses the HTTPS protocol:
git clone --mirror --bare HTTPs://codeup.aliyun.com/example/example.git
Clean up large files
Navigate into the cloned bare repository:
cd example.git
The git-filter-repo tool supports three methods for cleaning up large files: by file size, by file path, or by blob ID. For complete details, refer to the official documentation. The following examples demonstrate how to use these methods:
By file size
To remove all files larger than 100 MB, run the following command:
git filter-repo --strip-blobs-bigger-than 100M
The --strip-blobs-bigger-than argument supports the units K, M, and G. For example, you can replace 100M with 10K or 1G.
By file path
If you know the path of the large files, you can use a combination of the --path and --invert-paths arguments to remove them. For example, to remove the file path/of/large/file.lib and the entire bin/ directory from the repository's history, run the following command:
git filter-repo --path path/of/large/file.lib --path /bin/ --invert-paths
This combination of arguments preserves all files except for those specified by the --path argument, effectively removing the specified files and directories from the entire commit history.
By blob ID
If you know the blob IDs of the large files, you can list them in a file. For example, create a file named ids.txt with the following blob IDs:
e152814d14939a20f5399acf80b606ad018f872a
b747204ba81985a3f41314ef55d4c4a24868ede2
Then, run the following command:
git filter-repo --strip-blobs-with-ids ids.txt
Update the remote repository
First, update the configuration of your local example.git repository by running the following command:
git config remote.origin.mirror false
Because you have rewritten the repository's history, you must force-push your changes to update the remote repository.
git push -u origin refs/heads/*:refs/heads/* -f
git push -u origin refs/tags/*:refs/tags/* -f
Verify the results
On the Codeup web interface, verify that the large files have been removed from the commit history of all branches.
Trigger an immediate cleanup
After you force-push the changes, the size of the remote repository might not decrease immediately. This is because the old, unreferenced objects are removed during a periodic cleanup process.
To reclaim storage space immediately, an administrator must trigger a manual cleanup. In the repository's Settings, click Immediate Cleanup and then Immediate Delete to permanently remove the unreferenced large file objects.
The Immediate Cleanup button is located in the storage management section at the bottom of the repository's Settings > Basic Settings page.
Cleaning up large files in other scenarios
If you use the Agit-Flow push-and-review workflow, you might have introduced large files in original commits. For instructions on how to clean them up, see How to clean up large files introduced by Agit-Flow centralized reviews?