All Products
Search
Document Center

Alibaba Cloud DevOps:Clean up LFS storage and its impact

Last Updated:Jun 20, 2026

This topic explains how to clean up LFS binary resource files and resolve issues that can occur after deletion.

Clean up LFS binary resource files

When you use LFS to manage binary files, deleting a Git source file does not automatically delete the associated LFS resource file. You must clean it up manually.

As a repository administrator, click Settings in your repository. On the Large File Storage page, select and delete the files you no longer need.

Note

Run the following command to list the LFS resource files tracked by your repository. You can then safely delete any LFS files on the server that do not appear in this list.

git lfs ls-files:
  Show information about Git LFS files in the index and working tree.

Troubleshoot errors after deleting LFS files

Problem Description:

Deleting an LFS file from the Codeup management page may cause an error when you attempt to view it on the source code page.

The page displays a Git LFS badge, a file size of 0 Bytes · 0 line, an Object does not exist on the server error, and a View LFS file deletion records link.

This issue occurs because the Git LFS Pointer file still exists in the repository, but the corresponding oid file cannot be found in Git LFS storage.

Running a command such as git push in your terminal produces a similar error.

[404] Object does not exist on the server
[xxxxxxxxxxxxxxx...xxxxxxxxxxxxxxx] Object does not exist on the server

Solution:

  • If you have the original file, re-add and upload it to the Git LFS server:

    $ cp <original_file> xxx.data
    $ git add xxx.data
    $ git lfs push <remote> <branch> --all
    $ git checkout xxx.data
  • The original file is required to resolve this issue.