This topic describes FAQs about the capacity management of Alibaba Cloud DevOps code repositories. These FAQs cover capacity limits, approaches to clean up repository space, and methods to clean up large files (binary files) stored in LFS space or generated by Agit centralized reviews. This topic enables you to effectively manage and optimize the storage resources of your code repository.
Repository capacity and space cleanup
Overview: Learn about the capacity limits of your code repository and understand how to effectively clean up storage space to maintain optimal performance.
Limits on repository capacity:
By default, a code repository has 10 GB of storage space, including 5 GB of Git capacity and 5 GB of Git LFS space.
If the used capacity nears or reaches the upper limit, we recommend that you clean up storage space to avoid interrupted daily development activities.
If the used capacity exceeds the recommended threshold, you must upgrade your organization plan to obtain additional capacity.
Methods to clean up repository space:
Delete unnecessary files: Developers must regularly review and delete files that are no longer required.
Use the repository GC feature: Administrators can use the repository GC feature to compress storage objects and minimize disk usage.
Clean up LFS space: Manually clean up unnecessary Git LFS resource files from binary files managed by Git LFS.
Install a proper tool and clean up large files: Use the
git-filter-repotool to clean up historical large files by size, path, or blob ID.
Procedure:
Run the
git clone --mirror --barecommand to clone a bare repository.Access the cloned bare repository and run a cleanup command, such as
git filter-repo --strip-blobs-bigger-than 100M.Update the server-side repository and forcibly push the modified branches and tags.
On the Codeup page, confirm the successful cleanup of large files and apply the immediate cleanup policy.
For more information, see Capacity and cleanup instructions.
Method to clean up LFS space and cleanup impacts
Background: Git LFS is used to manage large binary files. However, after Git source files are deleted, the associated LFS resource files are not automatically deleted and continue to occupy storage space.
Clean up LFS resource files:
Find the code repository that you want to manage and choose Settings > Large File Storage. On the page that appears, click the Files tab and then select the files that you want to delete.
Run the
git lfs ls-filescommand to view the associated LFS resource files and delete those that are unnecessary.
Potential Issues and solutions after cleanup:
If you receive a prompt indicating that the files are missing on the Codeup source code page or encounter a failed local push, this issue may be caused by the existence of Git LFS Pointer files while their corresponding oid files have been deleted.
To resolve this issue, re-upload the missing files to the Git LFS server or acknowledging that file restoration is not possible if the original files are unavailable.
For more information, see How does LFS space clean up and what is the impact after cleaning up?
Method to clean up large files generated by Agit centralized reviews
Cause: Agit centralized reviews may generate large files. These files persist in special references even after the review is closed, which prevents their cleanup through the repository GC feature.
Solution:
Close all reviews that include large files.
Locate the special references created by the reviews.
Delete these special references on your local client. Example:
cd your_local_repository git push origin :refs/merge-requests/1367177/head git push origin :refs/keep-around/6349273477adaa3b9d18fea9033fe01f26656a1dApply the immediate cleanup policy and choose immediate deletion to fully free up storage space on the repository settings page.
For more information, see How to clean up the large file space introduced by Agit centralized review?
The preceding information aims to help you understand and resolve various code repository capacity management issues on the Alibaba Cloud DevOps platform. If you have any questions or need further help, contact us.