{"thread":{"id":"61849","subject":"Does GIT_SSH_COMMAND apply to all git commands that connect to remote?","startedAt":"2024-07-26T12:03:48Z","lastAt":"2024-07-26T15:33:27Z","messageCount":2,"participants":["Michał Iwanicki","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"499411","messageId":"3856e339-3c93-4c29-a668-334bdd7bff7a@3mdeb.com","threadId":"61849","inReplyTo":null,"subject":"Does GIT_SSH_COMMAND apply to all git commands that connect to remote?","fromName":"Michał Iwanicki","fromEmail":"michal.iwanicki@3mdeb.com","sentAt":"2024-07-26T08:25:40Z","receivedAt":"2024-07-26T12:03:48Z","isPatch":false,"sender":{"key":"michal.iwanicki@3mdeb.com","avatar":null},"body":"I'm asking this question, because in docs it explicitly mentions git fetch and git push. Does it apply do other commands\nlike git clone? If yes then maybe this information should be added?\n\nhttps://git-scm.com/docs/git/2.45.1#Documentation/git.txt-codeGITSSHCOMMANDcode\n\n> If either of these environment variables is set then git fetch and git push will use the specified command instead of\n> ssh when they need to connect to a remote system\n"},{"id":"499449","messageId":"xmqqy15oxj5p.fsf@gitster.g","threadId":"61849","inReplyTo":"3856e339-3c93-4c29-a668-334bdd7bff7a@3mdeb.com","subject":"Re: Does GIT_SSH_COMMAND apply to all git commands that connect to remote?","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2024-07-26T15:33:22Z","receivedAt":"2024-07-26T15:33:27Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Michał Iwanicki <michal.iwanicki@3mdeb.com> writes:\n\n> I'm asking this question, because in docs it explicitly mentions git fetch and git push. Does it apply do other commands\n> like git clone? If yes then maybe this information should be added?\n\n\"git clone\" is like \"init + fetch + reset --hard\" and \"git pull\" is\nlike \"fetch + merge/rebase\".  They both talk to a remote repository.\n\nWhen the partial clone feature that allows lazy fetching of missing\nobjects is in use, you cannot even name an exact command that may\ntrigger transferring of objects from remote repositories, as a fetch\nhappens on-demand any time you access an object that you ought to\nhave fetched during the initial clone but you didn't due to use of\nthe partial clone feature.\n\nAll of them use the usual remote transfer mechanism.\n\nI doubt that it makes sense to repeat it in any and all commands\nthat potentially connect to remote repositories.  In fact, \"git help\ngit\", the most central place, is where GIT_SSH_COMMAND and GIT_SSH\nenvironment variables are described.\n"}]}