On 2026-03-09 at 21:08:31, R. Diez wrote: > There is one more thing I am curious about. Git does not document how it uses SSH (or at least I couldn't find it in the standard end-user documentation). Git cannot launch a process on the target host over SSH, unless Git is already installed on the remote system. After all, the local system may have a different architecture (like AMD vs ARM), so you cannot copy a binary across. And I haven't seen the requirement that Git must be installed on the remote host when connecting over SSH. In that case, I would have probably seen somewhere a version compatibility table between client and server. > > So Git must be accessing files over SSH using the standard SSH file transfer operations. I am guessing that the same latency problem will apply here too, because uploads and downloads over SSH will also be sequential. Is my reasoning correct? Git doesn't use standard SSH file transfer operations. That would be much slower and it also works poorly when the remote side doesn't grant access to a file system, such as with a forge or gitolite. SSH allows multiple commands to be run over a single connection with `-oControlMaster`, which can improve performance. The benefit to running a single command for each Git operation is that we can do authentication once at the beginning of each command, whereas if we have a long-running SSH connection and attempt to do SFTP, we might interleave requests on different repositories, so each request would have to perform authentication. That's not a problem if you're using Unix permissions to control access, but it scales really poorly when your Git data is actually spread across many different file servers and the user is accessing multiple repositories, such as is common on forges. Using SSH file transfer operations also would not work well because you would effectively have to download every pack file and loose object to be sure you got the data you need, instead of getting a pack with only a few objects if that's all you need. However, you can of course mount a remote file system as SFTP with `sshfs` and use it as a local file system if you actually have a real file system on the remote side. That will send multiple requests over the connection when reading or writing since the `sshfs` does queue those. > Or does Git attempt to find out whether there is a Git on the other side? What happens if there isn't then? Git invokes git-upload-pack on the remote side and talks to it over standard input and output. If there isn't one, then the operation fails. Here's an example: ---- % GIT_TRACE=1 git ls-remote git@github.com:git/git.git 22:41:36.731673 git.c:502 trace: built-in: git ls-remote git@github.com:git/git.git 22:41:36.731937 run-command.c:673 trace: run_command: unset GIT_PREFIX; GIT_PROTOCOL=version=2 ssh -o SendEnv=GIT_PROTOCOL git@github.com 'git-upload-pack '\''git/git.git'\''' 22:41:36.731952 run-command.c:765 trace: start_command: /usr/bin/ssh -o SendEnv=GIT_PROTOCOL git@github.com 'git-upload-pack '\''git/git.git'\''' ---- I don't have any systems without Git on them, so I can't demonstrate the failure case. -- brian m. carlson (they/them) Toronto, Ontario, CA