Follow the steps to clean up LFS binary resource file and solve the issues like local push fails after deleting LFS resource documents.
Clean up LFS binary resource file
When managing binary files with LFS, deleting Git source files does not automatically remove the associated LFS resource files. You can clean them up manually by following the steps below:
Click Settings.
Click Large File Storage.
Select the files you want to delete
Click Delete.
To view the LFS resource files currently associated with the repository, use the following command. Then, delete any unnecessary LFS resource files outside this list as needed:
git lfs ls-files:
//Show information about Git LFS files in the index and working tree.
The code repository page cannot be viewed or local push fails after deleting LFS resource documents
This issue occurs because the Git LFS Pointer file remains in the repository, but the related oid file is missing.
Similar prompts, as indicated below, appears on Codeup, or when executing commands such as git push.
[404] Object does not exist on the server
[xxxxxxxxxxxxxxx...xxxxxxxxxxxxxxx] Object does not exist on the server
To solve this, re-add and upload the deleted files to the Git LFS server.
$ cp original file xxx.data
$ git add xxx.data
$ git lfs push <remote> <branch> --all
$ git checkout xxx.data