9

I am trying to push a commit. But I keep getting an error saying:

error: GH008: Your push referenced at least 1 unknown Git LFS object

The file it is questioning is:

 (missing) SRP/com.unity.shadergraph/.data/texture_2d_lod_node.PNG (b262d71d68d478f6b6c3dc3086451a764e065b8608a65104e17cb8aefefa5f76)

Now I went to the folder and that file does exist:

Screenshot of folder/file

So my question is why does it keep giving me this error?

codewario
  • 19,553
  • 20
  • 90
  • 159
Marc Rasmussen
  • 19,771
  • 79
  • 203
  • 364

3 Answers3

23

This could happen you are migrating from one remote repository to another. Assuming the old repository is named old-origin,

git lfs fetch --all old-origin
git lfs push origin --all

should synchronize all LFS objects in your git commit history.

jadelord
  • 1,511
  • 14
  • 19
6

It looks like the object is somehow missing from the LFS object store. LFS objects are located at .git/lfs/objects. If your missing object was there it would be located at a path like b2/62/d71d68...

git-lfs adds objects when it runs the clean filter before staging files. Assuming the missing object is for the latest revision of the file, you can force the clean filter to rerun with a command like the following:

git add --renormalize path/to/file
Jason Haslam
  • 2,617
  • 13
  • 19
2

That error means that your Git push contains a reference to a Git LFS object that was never uploaded to the server.

Try to run git lfs push origin --all to upload all local Git LFS objects. Afterwards git push should work.


Background: Git LFS works by storing large files in a data storage outside of the Git repository. The separately stored files are then only referenced through so-called Git LFS pointer files in the Git repository (you can learn more in Git LFS 101). If a Git LFS user has a misconfigured local client, then it can happen that LFS files are 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. The error: GH008: Your push referenced at least 1 unknown Git LFS object protects the user from that situation.

Lars Schneider
  • 5,530
  • 4
  • 33
  • 58