Jaap Joris Vens
Jaap Joris Vens

Reputation: 3560

Where can I find the git-lfs-authenticate command?

I can successfully push a git repository that uses Git LFS to Github, but when I try to push it to my own server I get the following error: git-lfs-authenticate: not found.

$ git push origin main |& cat
batch request: sh: 1: git-lfs-authenticate: not found: exit status 127
Uploading LFS objects:   0% (0/1), 0 B | 0 B/s, done.
error: failed to push some refs to 'git.example.com:'

On the local host, I use git-lfs/2.13.2 and on the remote host git-lfs/2.7.1. These are the current versions of Debian 10 and 11, respectively. I have tried using the latest version of Git LFS on both hosts by placing the git-lfs binary in /usr/local/bin. The output is now slightly different, but I still get the same error:

$ git push origin main |& cat
batch request: sh: 1: git-lfs-authenticate: not found: exit status 127
error: failed to push some refs to 'git.example.com:'

I have also tried searching for a binary named git-lfs-authenticate but it is not present in any of the releases of Git LFS. I have also tried reading the Git LFS Server Documentation which mentions the git-lfs-authenticate command, but it doesn't explain where to find it or how to implement it.

Upvotes: 2

Views: 11631

Answers (2)

mbwmd
mbwmd

Reputation: 86

You probably just forgot the definition of where git will find the LFS-Backend. As @bk2204 already mentioned, and we assume, you checked out your repo via ssh, but most LFS backends do not support ssh connections.

Thus, you'll need to define that all/only LFS-Blobs shall be sent to https, even though you may check out the repo itself via ssh:

git clone ssh://git-server.com/foo/bar.git .
git config -f .lfsconfig lfs.url https://git-server.com/foo/bar.git/info/lfs
git add .lfsconfig && git commit -m"define lfs backend" && git push

What the correct lfs http url is, depends on your git host.

Upvotes: 2

bk2204
bk2204

Reputation: 76744

The protocol of Git LFS is mostly HTTP-based, and the git-lfs-authenticate command is used to allow a user to authenticate with a remote server to get authentication credentials to use over the HTTP-based protocol. Git LFS doesn't currently have a pure SSH-based protocol.

As a result, it's not possible to ship a generic version of this client because it requires interacting with the HTTP server, which can't be done in a generic way. You could build your own that interacts with your own HTTP server, though.

Upvotes: 1

Related Questions