TortoiseGit SSH-Client Setting Change Reconfigures Key-Format and Agent-Usage Without Unified Migration Path
0 reputation · 22 Apr 2023, 10:31 UTC
0 reputation · 22 Apr 2023, 10:31 UTC
TortoiseGit's Settings > Network > SSH client provides a binary selection between PuTTY (TortoiseGitPLink) and Git for Windows OpenSSH, yet the underlying Git transport configuration resides outside the UI. The chosen backend determines whether Pageant or ssh-agent is used, whether private keys are interpreted as .ppk or OpenSSH format, and how host-key acceptance prompts are presented. Switching the setting does not automatically reconfigure existing credentials or migrate key formats, and the interaction with Git for Windows's own ssh.exe invocation, the GIT_SSH environment variable, and repository-specific .git/config entries remains ambiguous in mixed-deployment environments. Exact defaults and minimum supported versions vary by release, as documented in TortoiseGit and Git for Windows release notes.
Does changing the TortoiseGit SSH-client setting alter active repository authentication when .ppk and OpenSSH keys coexist? What criteria does TortoiseGit apply to select between Pageant, ssh-agent, and direct key-file loading after a setting change? Under what conditions does host-key acceptance behavior differ between the two backends in non-interactive or scripted contexts?
35775 reputation · 22 Apr 2023, 12:20 UTC
No. Changing TortoiseGit's Settings > Network > SSH client does not automatically alter authentication for an existing repository when .ppk and OpenSSH keys coexist. The switch only changes which backend TortoiseGit invokes for new SSH operations. It does not migrate keys, reload Pageant or ssh-agent, change remote URLs, or override GIT_SSH, GIT_SSH_COMMAND, core.sshCommand, or repository-specific .git/config entries. If such an override exists, the UI change may have no effect.
TortoiseGit applies roughly this order:
Defaults are version-sensitive, so do not rely on UI defaults for CI or scripts.
git config --get core.sshCommand, and environment variables GIT_SSH, GIT_SSH_COMMAND, SSH_AUTH_SOCK.This assumes a recent TortoiseGit release with both backends, Git for Windows installed for OpenSSH, an SSH remote URL, and no environment or repository config overriding the SSH command. Exact defaults and minimum supported versions vary by release and should be checked against your installed versions.
git config --get remote.origin.url
git config --get core.sshCommand
echo 'GIT_SSH=$GIT_SSH GIT_SSH_COMMAND=$GIT_SSH_COMMAND SSH_AUTH_SOCK=$SSH_AUTH_SOCK'
Then run git fetch against the remote and compare observed agent and key-format errors against the selected backend.
Missing diagnostic detail: does the repository or environment define core.sshCommand, GIT_SSH, or GIT_SSH_COMMAND? If any override exists, the TortoiseGit UI setting alone will not change authentication, and the fix must target the override instead of the backend selector.
Use comments to ask for clarification. Post a solution as an answer.
6,690 reputation · 22 Apr 2023, 18:37 UTC
When toggling between TortoiseGitPLink and Git for Windows OpenSSH, the UI setting alone does not rewrite GIT_SSH or repository-level core.sshCommand entries. A reliable check is to run git config --show-origin --get-all core.sshCommand and inspect env | grep -i ssh from a clean shell; any explicit value there overrides the dropdown. For key-format migration, puttygen can convert .ppk to OpenSSH (puttygen key.ppk -O private-openssh -o key) and vice versa, but TortoiseGit never invokes this automatically. In non-interactive scripts, the PuTTY backend surfaces host-key prompts via a console dialog unless -batch is passed to plink, whereas OpenSSH honors StrictHostKeyChecking=no in ~/.ssh/config or -o flags. Minimum versions: TortoiseGit 2.11+ for reliable OpenSSH detection, Git for Windows 2.30+ for bundled ssh.exe parity.