Skip to content

Git LFS integrity check

Previously, if a Git LFS user had a misconfigured local client it was possible that LFS files were added and locally referenced but not uploaded to the LFS data storage. Consequently, any other user of the repository would not be able to download the referenced LFS files and the repository would be stuck in a broken state.

We tackled this problem by ensuring that all referenced LFS files in a push have been uploaded to GitHub successfully. If the check detects referenced files that have not been uploaded, then it will reject the push with an error like this:

$ git push
...
remote: error: GH008: Your push referenced at least 1 unknown Git LFS object:
remote:     5d865e959b2466918c9863afca942d0fb89d7c9ac0c99bafc3749504ded97730
remote: Try to push them with 'git lfs push --all'.
To github.com:larsxschneider/lfs-demo.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@github.com:larsxschneider/lfs-demo.git'