I have a very old repository I have been using and at some point some LFS files have gone missing. Quite a few of them. When I try and push to a new repository in Gitlab, I get the following error
GitLab: LFS objects are missing. Ensure LFS is properly set up or try a manual
Other QA for git-lfs (here, here) indicate that usually some variant of git lfs push --all
but I don't have a working repo with these files anymore and they are gone for good. Gitlab ignores pushing with --no-verify and still gives the error.
Running git lfs fetch --all
gives a lengthy list of missing OID
[43cb9e6d1d15bb8d31af911aa69a15a67174c5df73dabc85294ce08198cac468] Object does not exist on the server or you don't have permissions to access it: [404] Object does not exist on the server or you don't have permissions to access it
[454907d530534af9cc95903820c0a632a851b45de98ba18e1de117b8a649f8ac] Object does not exist on the server or you don't have permissions to access it: [404] Object does not exist on the server or you don't have permissions to access it
[ce1314f0c4cb05f349540fa144d33faeb2281ae552cf75dc866a8350d90fd2ac] Object does not exist on the server or you don't have permissions to access it: [404] Object does not exist on the server or you don't have permissions to access it
[d5e8925d273cb00341f00d0f40b39f97cced1e833ef687de2d4663836e7f4e45] Object does not exist on the server or you don't have permissions to access it: [404] Object does not exist on the server or you don't have permissions to access it
...
Another post here contains scripts to remove LFS entirely by checking out every commit and smudging LFS files, but this seems highly detrimental to the repository moving forward. Still another indicates a path to remove the LFS file entirely (here).
All these issues seem to be suboptimal:
- Removing LFS will grossly bloat the repo and the smudge is likely to fail for the files already broken, anyway
- Git pull/push -all is not an option because the files are gone for good
- Removing the LFS is not right because a version of the files exist today only the object in some branch in the past is missing, so all instructions on how to remove LFS will break the repo.
Is there a way to have GitLab not ignore no-verify or to efficiently filter out specific OID from the history? I don't mind if the files are missing forever but I had hoped to preserve history.
I know that I can run git log --all -p -S 43cb9e6d1d15bb8d31af911aa69a15a67174c5df73dabc85294ce08198cac468
to get the commit and file (though it takes 5-10min to run PER OID, so this would take many hours), but I don't know what to do with that.