I’m encountering an issue with Git LFS where it persistently uses HTTPS instead of SSH, despite all my configurations pointing to SSH. This is causing problems when I try to push to my repository.
My setup:
Git version: 2.45.2.windows.1
Git LFS version: 3.5.1
OS: Windows
The issue:
When I try to push, I get the following error:
Remote "origin" does not support the Git LFS locking API. Consider disabling it with:
$ git config lfs.https://git.myurl.de/mnt/raid/git-repos/reponame.git/info/lfs.locksverify false
batch request: Requested repository: /mnt/raid/git-repos/reponame.git/info/lfs
Checking path: /mnt/raid/git-repos//mnt/raid/git-repos/reponame.git/info/lfs
Repository not found at /mnt/raid/git-repos//mnt/raid/git-repos/myurl.git/info/lfs: exit status 1
error: failed to push some refs to 'ssh://git.myurl.de:22/mnt/raid/git-repos/reponame.git'
My configuration:
.git/config:
[core]
repositoryformatversion = 0
filemode = false
bare = false
logallrefupdates = true
symlinks = false
ignorecase = true
[lfs]
repositoryformatversion = 0
url = ssh://[email protected]:22/mnt/raid/git-repos/reponame/info/lfs
[lfs "ssh"]
variant = ssh
priority = 1
[remote "origin"]
url = ssh://[email protected]:22/mnt/raid/git-repos/reponame.git
fetch = +refs/heads/*:refs/remotes/origin/*
[lfs "https://git.myurl.de/mnt/raid/git-repos/reponame.git/info/lfs"]
access = ssh
.lfsconfig:
[lfs]
url = ssh://[email protected]:22/mnt/raid/git-repos/reponame.git/info/lfs
[lfs "ssh://[email protected]:22/mnt/raid/git-repos/reponame.git"]
access = basic
Git LFS environment:
git-lfs/3.5.1 (GitHub; windows amd64; go 1.21.7; git e237bb3a)
git version 2.45.2.windows.1
Endpoint=https://git.myurl.de/mnt/raid/git-repos/reponame.git/info/lfs (auth=none)
[email protected]:/mnt/raid/git-repos/reponame.git/info/lfs
LocalWorkingDir=D:Gitreponame
LocalGitDir=D:Gitreponame.git
LocalGitStorageDir=D:Gitreponame.git
LocalMediaDir=D:Gitreponame.gitlfsobjects
LocalReferenceDirs=
TempDir=D:Gitreponame.gitlfstmp
ConcurrentTransfers=8
TusTransfers=false
BasicTransfersOnly=false
SkipDownloadErrors=false
FetchRecentAlways=false
FetchRecentRefsDays=7
FetchRecentCommitsDays=0
FetchRecentRefsIncludeRemotes=true
PruneOffsetDays=3
PruneVerifyRemoteAlways=false
PruneVerifyUnreachableAlways=false
PruneRemoteName=origin
LfsStorageDir=D:Gitreponame.gitlfs
AccessDownload=none
AccessUpload=none
DownloadTransfers=basic,lfs-standalone-file,ssh
UploadTransfers=basic,lfs-standalone-file,ssh
GIT_EXEC_PATH=C:/Program Files/Git/mingw64/libexec/git-core
git config filter.lfs.process = "git-lfs filter-process"
git config filter.lfs.smudge = "git-lfs smudge -- %f"
git config filter.lfs.clean = "git-lfs clean -- %f"
As you can see, despite all my configurations pointing to SSH, the Endpoint in the Git LFS environment is still using HTTPS. I’ve tried various solutions including:
Setting lfs.url explicitly
Setting lfs.ssh.variant and lfs.ssh.priority
Uninstalling and reinstalling Git LFS hooks
However, the issue persists. The HTTPS URL keeps reappearing in the Git LFS environment, and I’m unable to push due to the error mentioned above.
How can I force Git LFS to use SSH instead of HTTPS? Any help would be greatly appreciated!
Also I have a ssh config in place:
Host git.myurl.de
ProxyCommand cloudflared access ssh --hostname %h
User git
IdentityFile C:UsersTim.sshid_rsa
The server is running a raspberry pi 4, with nginx, ssh public/private key auth, a raid and a barre repo. Also access for normal git push works fine. Just the lfs is throwing the error with the wierd constructed address:
/mnt/raid/git-repos//mnt/raid/git-repos/myurl.git/info/lfs
Im at the end of my capability here and very frustrated after like 2 days of trying
I tried setting the ssh config in various ways like added .lfsconfig, checked global git configs, etc.
On the server the git-lfs-transfer command is missing even after reinstall.
Here is my ssh config of serer at /etc/ssh/sshd_config
# This is the sshd server system-wide configuration file. See
# sshd_config(5) for more information.
# This sshd was compiled with PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented. Uncommented options override the
# default value.
Include /etc/ssh/sshd_config.d/*.conf
#Port 22
#AddressFamily any
ListenAddress 0.0.0.0
#ListenAddress ::
#HostKey /etc/ssh/ssh_host_rsa_key
#HostKey /etc/ssh/ssh_host_ecdsa_key
#HostKey /etc/ssh/ssh_host_ed25519_key
# Ciphers and keying
#RekeyLimit default none
# Logging
#SyslogFacility AUTH
#LogLevel INFO
# Authentication:
#LoginGraceTime 2m
#PermitRootLogin prohibit-password
#StrictModes yes
#MaxAuthTries 6
#MaxSessions 10
PubkeyAuthentication yes
# Expect .ssh/authorized_keys2 to be disregarded by default in future.
#AuthorizedKeysFile .ssh/authorized_keys .ssh/authorized_keys2
#AuthorizedPrincipalsFile none
#AuthorizedKeysCommand none
#AuthorizedKeysCommandUser nobody
# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
#HostbasedAuthentication no
# Change to yes if you don't trust ~/.ssh/known_hosts for
# HostbasedAuthentication
#IgnoreUserKnownHosts no
# Don't read the user's ~/.rhosts and ~/.shosts files
#IgnoreRhosts yes
# To disable tunneled clear text passwords, change to no here!
PasswordAuthentication no
#PermitEmptyPasswords no
# Change to yes to enable challenge-response passwords (beware issues with
# some PAM modules and threads)
KbdInteractiveAuthentication no
# Kerberos options
#KerberosAuthentication no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes
#KerberosGetAFSToken no
# GSSAPI options
#GSSAPIAuthentication no
#GSSAPICleanupCredentials yes
#GSSAPIStrictAcceptorCheck yes
#GSSAPIKeyExchange no
# Set this to 'yes' to enable PAM authentication, account processing,
# and session processing. If this is enabled, PAM authentication will
# be allowed through the KbdInteractiveAuthentication and
# PasswordAuthentication. Depending on your PAM configuration,
# PAM authentication via KbdInteractiveAuthentication may bypass
# the setting of "PermitRootLogin prohibit-password".
# If you just want the PAM account and session checks to run without
# PAM authentication, then enable this but set PasswordAuthentication
# and KbdInteractiveAuthentication to 'no'.
UsePAM yes
#AllowAgentForwarding yes
#AllowTcpForwarding yes
#GatewayPorts no
X11Forwarding yes
#X11DisplayOffset 10
#X11UseLocalhost yes
#PermitTTY yes
PrintMotd no
#PrintLastLog yes
#TCPKeepAlive yes
#PermitUserEnvironment no
#Compression delayed
#ClientAliveInterval 0
#ClientAliveCountMax 3
#UseDNS no
#PidFile /run/sshd.pid
#MaxStartups 10:30:100
#PermitTunnel no
#ChrootDirectory none
#VersionAddendum none
# no default banner path
#Banner none
# Allow client to pass locale environment variables
AcceptEnv LANG LC_*
# override default of no subsystems
Subsystem sftp /usr/lib/openssh/sftp-server
# Example of overriding settings on a per-user basis
#Match User anoncvs
# X11Forwarding no
# AllowTcpForwarding no
# PermitTTY no
# ForceCommand cvs server
Claude told me I could revert to old protocols to supplement for the missing git-fls-transfer command. So I added some old transfer lines to
git lfs env on server:
+git-lfs/3.5.1 (GitHub; linux arm64; go 1.21.8)
git version 2.43.0
Endpoint=https://git.myurl.de/mnt/raid/git-repos/reponame.git/info/lfs (auth=ssh)
[email protected]:/mnt/raid/git-repos/reponame.git/info/lfs
LocalWorkingDir=
LocalGitDir=/mnt/raid/git-repos/reponame.git
LocalGitStorageDir=/mnt/raid/git-repos/reponame.git
LocalMediaDir=/mnt/raid/git-repos/reponame/lfs/objects
LocalReferenceDirs=
TempDir=/mnt/raid/git-repos/reponame/lfs/tmp
ConcurrentTransfers=8
TusTransfers=false
BasicTransfersOnly=false
SkipDownloadErrors=false
FetchRecentAlways=false
FetchRecentRefsDays=7
FetchRecentCommitsDays=0
FetchRecentRefsIncludeRemotes=true
PruneOffsetDays=3
PruneVerifyRemoteAlways=false
PruneVerifyUnreachableAlways=false
PruneRemoteName=origin
LfsStorageDir=/mnt/raid/git-repos/reponame.git/lfs
AccessDownload=ssh
AccessUpload=ssh
DownloadTransfers=basic,lfs-standalone-file,ssh
UploadTransfers=basic,lfs-standalone-file,ssh
GIT_EXEC_PATH=/usr/lib/git-core
git config filter.lfs.process = "git-lfs filter-process"
git config filter.lfs.smudge = "git-lfs smudge -- %f"
git config filter.lfs.clean = "git-lfs clean -- %f"
New git lfs env on client:
Endpoint=https://git.myurl.de/mnt/raid/git-repos/reponame.git/info/lfs (auth=ssh)
[email protected]:/mnt/raid/git-repos/reponame.git/info/lfs
00:24:22.749698 trace git-lfs: exec: git '-c' 'filter.lfs.smudge=' '-c' 'filter.lfs.clean=' '-c' 'filter.lfs.process=' '-c' 'filter.lfs.required=false' 'rev-parse' '--git-dir'
00:24:22.766341 trace git-lfs: exec: git '-c' 'filter.lfs.smudge=' '-c' 'filter.lfs.clean=' '-c' 'filter.lfs.process=' '-c' 'filter.lfs.required=false' 'remote'
LocalWorkingDir=D:Gitreponame
LocalGitDir=D:Gitreponame.git
LocalGitStorageDir=D:Gitreponame.git
LocalMediaDir=D:Gitforgotten-strats.gitlfsobjects
LocalReferenceDirs=
TempDir=D:Gitreponame.gitlfstmp
ConcurrentTransfers=8
TusTransfers=false
BasicTransfersOnly=false
SkipDownloadErrors=false
FetchRecentAlways=false
FetchRecentRefsDays=7
FetchRecentCommitsDays=0
FetchRecentRefsIncludeRemotes=true
PruneOffsetDays=3
PruneVerifyRemoteAlways=false
PruneVerifyUnreachableAlways=false
PruneRemoteName=origin
LfsStorageDir=D:Gitreponame.gitlfs
AccessDownload=ssh
AccessUpload=ssh
DownloadTransfers=basic,lfs-standalone-file,ssh
UploadTransfers=basic,lfs-standalone-file,ssh
GIT_CURL_VERBOSE=1
GIT_EXEC_PATH=C:/Program Files/Git/mingw64/libexec/git-core
GIT_TRACE=1
GIT_TRANSFER_TRACE=1
git config filter.lfs.process = "git-lfs filter-process"
git config filter.lfs.smudge = "git-lfs smudge -- %f"
git config filter.lfs.clean = "git-lfs clean -- %f"
00:24:22.783501 trace git-lfs: filepathfilter: creating pattern ".git" of type gitignore
00:24:22.783501 trace git-lfs: filepathfilter: creating pattern "**/.git" of type gitignore
00:24:22.783501 trace git-lfs: filepathfilter: accepting "tmp"