For my website’s git repository, I actually host it on two remotes — one which is publicly accessible on GitHub and another private one in Gitea. I pushed a draft post containing images to the Gitea repository, but when I tried to open this branch on another computer it was unable to find the images:
$ git checkout fantastic_arcade
Updating files: 100% (106/106), done.
Downloading content/blog/20241027181926_floor.jpg (184 KB)
Error downloading object: content/blog/20241027181926_floor.jpg (6f9c27f): Smudge error: Error downloading content/blog/20241027181926_floor.jpg (6f9c27fa7958db1c6b796877b4b51f7b521a94277789d7eb188920244dbc14d6): [6f9c27fa7958db1c6b796877b4b51f7b521a94277789d7eb188920244dbc14d6] Object does not exist on the server: [404] Object does not exist on the server
Errors logged to '/home/exodrifter/notes/logbook/.git/lfs/logs/20241105T211709.912196301.log'.
Use `git lfs logs last` to view the log.
error: external filter 'git-lfs filter-process' failed
fatal: content/blog/20241027181926_floor.jpg: smudge filter lfs failed
Checking the computer where I originally pushed the branch, the LFS files exist locally and have already been pushed to the Gitea server.
As it turns out, this was because Git (version 2.47.0) was trying to pull the assets from the GitHub server despite the fact that the branch was pushed to the Gitea server. To fix this, I needed to manually direct Git to download the files from the Gitea remote before checking out the branch:
Looking into this more, it appears this happens because git
does not supply remote information to git lfs
, so it has to assume the remote that you’re using:
technoweenie @ github, git-lfs/git-lfs#1759
Git’s internal hooks don’t supply remote info to Git LFS, so we have to assume the default branch.
technoweenie @ github, git-lfs/git-lfs#436
Git LFS has no idea what remote was pulled from in the smudge command, so it defaults to
origin
.