Using with GitHub - How to get either SSH or HTTPS to work? #6114
-
Hi all, I have a new machine with a fresh install of arch-linux, git and a git-lfs. I have copied my ~/.ssh folder from my old machine to my new machine. ssh works as expected.
Here is the output of
I've been googling and chatgpt-ing around, many sources say that github does not support git-lfs over ssh, but the sources are at least 5 years old. Does github support git-lfs over ssh in 2025? What is currently the best practice? My old machine is running git-lfs 2.7.1, it can push and pull okay. Using GIT_TRACE=1 reveals that it is using https. I have tried switching to https to download the files but it appears that git-lfs ignores anything I throw at it. Here is my current
Here is the output of
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hey, thanks for the question, and I'm sorry you're having trouble. I think the short version of my answer below is that you should check whether you have a If you do have a
So far as I know, GitHub does not support the "pure" SSH-only Git LFS transfer protocol yet, which the Git LFS client began to support with our v3.0.0 release. That's the reason you see in your Git LFS trace logs the client trying to run the However, GitHub does support the SSH authentication mechanism for Git LFS, by which the client authenticates over SSH, but is then redirected to use HTTPS for the actual Git LFS Batch API requests and object transfer requests. By default, the Git LFS client will fall back to trying this technique if the server doesn't support the "pure" SSH-only Git LFS protocol. If that was happening, it would appear in your trace logs as an attempt by the client to run the I just re-tested this behaviour with one of my own GitHub repositories and it works as expected for me. If you had If you do encounter specific problems with GitHub's SSH services, though, you should reach out via GitHub's Support site for help, as this project is only for the open-source Git LFS client. Putting SSH issues aside, the fact that you're seeing no Beginning with Git LFS v3.6.0, the changes from PR #5699 mean that But the In a normal test repository cloned from GitHub with a Git LFS file named
Given how closely my trace log matches yours in this scenario, I suspect you have a similar situation, where you were still able to fetch Git LFS objects with the client prior to v3.6.0 by running |
Beta Was this translation helpful? Give feedback.
-
Good spot with the Thanks for your help and your speedy response, cheers mate! |
Beta Was this translation helpful? Give feedback.
Hey, thanks for the question, and I'm sorry you're having trouble.
I think the short version of my answer below is that you should check whether you have a
.gitattributes
file in your repository and if it hasfilter=lfs
lines for all the file patterns you expect to be treated as Git LFS files. Without those in place, recent versions of thegit lfs pull
command will not find Git LFS files and fetch their objects.If you do have a
.gitattributes
in your branch'sHEAD
, you could use thegit check-attr
command to see if a file you expect to be a Git LFS file actually matches afilter=lfs
attribute. Here's a quick example of what that should look like, with a singlefilter=lfs
pattern for*.bin
…