Repository capacity issues

更新时间:
复制 MD 格式

Frequently asked questions about managing code repository capacity in Alibaba Cloud DevOps, including capacity limits, repository space cleanup, and methods to remove large files (binary files) stored in LFS space or generated by Agit centralized reviews.

Repository capacity and space cleanup

Overview: Understand the capacity limits of your code repository and how to 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, clean up storage space to avoid disruptions to daily development.

  • 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: Regularly review and delete files that are no longer needed.

  • Use the repository GC feature: Administrators can use the repository GC feature to compress storage objects and minimize disk usage.

  • Clean up LFS space: Remove unnecessary Git LFS resource files from binary files managed by Git LFS.

  • Install a proper tool and clean up large files: Use git-filter-repo to remove historical large files by size, path, or blob ID.

Procedure:

  1. Run the git clone --mirror --bare command to clone a bare repository.

  2. Access the cloned bare repository and run a cleanup command, such as git filter-repo --strip-blobs-bigger-than 100M.

  3. Update the server-side repository and forcibly push the modified branches and tags.

  4. On the Codeup page, confirm the successful cleanup of large files and apply the immediate cleanup policy.

For more information, see Storage capacity and cleanup.

Method to clean up LFS space and cleanup impacts

Background: Git LFS manages large binary files. However, when Git source files are deleted, the associated LFS resource files are not automatically removed 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-files command to view the associated LFS resource files and delete those that are unnecessary.

  • Potential issues and solutions after cleanup:

    If files appear missing on the Codeup source code page or a local push fails, Git LFS Pointer files may still exist while their corresponding oid files have been deleted.

    To resolve this issue, re-upload the missing files to the Git LFS server. If the original files are unavailable, file restoration is not possible.

For more information, see Clean up LFS storage and its impact

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, preventing cleanup through the repository GC feature.

Solution:

  1. Close all reviews that include large files.

  2. Locate the special references created by the reviews.

  3. 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/6349273477adaa3b9d18fea9033fe01f26656a1d
  4. Apply the immediate cleanup policy and choose immediate deletion to fully free up storage space on the repository settings page.

For more information, see Clean up large files in Agit centralized reviews

The preceding information helps you understand and resolve code repository capacity management issues on the Alibaba Cloud DevOps platform. If you have any questions, contact us.