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.1Git LFS version: 3.5.1OS: 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 falsebatch request: Requested repository: /mnt/raid/git-repos/reponame.git/info/lfsChecking path: /mnt/raid/git-repos//mnt/raid/git-repos/reponame.git/info/lfsRepository not found at /mnt/raid/git-repos//mnt/raid/git-repos/myurl.git/info/lfs: exit status 1error: 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://git@git.myurl.de:22/mnt/raid/git-repos/reponame/info/lfs[lfs "ssh"] variant = ssh priority = 1[remote "origin"] url = ssh://git@git.myurl.de: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://git@git.myurl.de:22/mnt/raid/git-repos/reponame.git/info/lfs[lfs "ssh://git@git.myurl.de: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.1Endpoint=https://git.myurl.de/mnt/raid/git-repos/reponame.git/info/lfs (auth=none) SSH=git@git.forgottenstrats.de:/mnt/raid/git-repos/reponame.git/info/lfsLocalWorkingDir=D:\Git\reponameLocalGitDir=D:\Git\reponame\.gitLocalGitStorageDir=D:\Git\reponame\.gitLocalMediaDir=D:\Git\reponame\.git\lfs\objectsLocalReferenceDirs=TempDir=D:\Git\reponame\.git\lfs\tmpConcurrentTransfers=8TusTransfers=falseBasicTransfersOnly=falseSkipDownloadErrors=falseFetchRecentAlways=falseFetchRecentRefsDays=7FetchRecentCommitsDays=0FetchRecentRefsIncludeRemotes=truePruneOffsetDays=3PruneVerifyRemoteAlways=falsePruneVerifyUnreachableAlways=falsePruneRemoteName=originLfsStorageDir=D:\Git\reponame\.git\lfsAccessDownload=noneAccessUpload=noneDownloadTransfers=basic,lfs-standalone-file,sshUploadTransfers=basic,lfs-standalone-file,sshGIT_EXEC_PATH=C:/Program Files/Git/mingw64/libexec/git-coregit 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 explicitlySetting lfs.ssh.variant and lfs.ssh.priorityUninstalling 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:\Users\Tim\.ssh\id_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 anyListenAddress 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 10PubkeyAuthentication 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 noX11Forwarding yes#X11DisplayOffset 10#X11UseLocalhost yes#PermitTTY yesPrintMotd 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 variablesAcceptEnv LANG LC_*# override default of no subsystemsSubsystem 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.0Endpoint=https://git.myurl.de/mnt/raid/git-repos/reponame.git/info/lfs (auth=ssh) SSH=git@git.myurl.de:/mnt/raid/git-repos/reponame.git/info/lfsLocalWorkingDir=LocalGitDir=/mnt/raid/git-repos/reponame.gitLocalGitStorageDir=/mnt/raid/git-repos/reponame.gitLocalMediaDir=/mnt/raid/git-repos/reponame/lfs/objectsLocalReferenceDirs=TempDir=/mnt/raid/git-repos/reponame/lfs/tmpConcurrentTransfers=8TusTransfers=falseBasicTransfersOnly=falseSkipDownloadErrors=falseFetchRecentAlways=falseFetchRecentRefsDays=7FetchRecentCommitsDays=0FetchRecentRefsIncludeRemotes=truePruneOffsetDays=3PruneVerifyRemoteAlways=falsePruneVerifyUnreachableAlways=falsePruneRemoteName=originLfsStorageDir=/mnt/raid/git-repos/reponame.git/lfsAccessDownload=sshAccessUpload=sshDownloadTransfers=basic,lfs-standalone-file,sshUploadTransfers=basic,lfs-standalone-file,sshGIT_EXEC_PATH=/usr/lib/git-coregit 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) SSH=git@git.myurl.de:/mnt/raid/git-repos/reponame.git/info/lfs00: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:\Git\reponameLocalGitDir=D:\Git\reponame\.gitLocalGitStorageDir=D:\Git\reponame\.gitLocalMediaDir=D:\Git\forgotten-strats\.git\lfs\objectsLocalReferenceDirs=TempDir=D:\Git\reponame\.git\lfs\tmpConcurrentTransfers=8TusTransfers=falseBasicTransfersOnly=falseSkipDownloadErrors=falseFetchRecentAlways=falseFetchRecentRefsDays=7FetchRecentCommitsDays=0FetchRecentRefsIncludeRemotes=truePruneOffsetDays=3PruneVerifyRemoteAlways=falsePruneVerifyUnreachableAlways=falsePruneRemoteName=originLfsStorageDir=D:\Git\reponame\.git\lfsAccessDownload=sshAccessUpload=sshDownloadTransfers=basic,lfs-standalone-file,sshUploadTransfers=basic,lfs-standalone-file,sshGIT_CURL_VERBOSE=1GIT_EXEC_PATH=C:/Program Files/Git/mingw64/libexec/git-coreGIT_TRACE=1GIT_TRANSFER_TRACE=1git 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 gitignore00:24:22.783501 trace git-lfs: filepathfilter: creating pattern "**/.git" of type gitignore00:24:22.783501 trace git-lfs: filepathfilter: accepting "tmp"