Question
Sourcetree 4.0.1 SSH key selection – how to explicitly choose a key?
Dev Finch
0 reputation · 01 Dec 2021, 19:21 UTC
37.1K views0
Goal
Ensure that Sourcetree 4.0.1 uses a specific SSH key for Git operations when more than one key is available in the system’s SSH agent.
Constraints
The application does not expose a UI to choose the key, and the key used appears to be the first returned by the agent or the default key. This can cause failed pushes or pulls in environments with multiple identities.
Questions
- Does Sourcetree 4.0.1 provide any internal setting or configuration option to specify the key to use per remote?
- If not, can the ordering of keys in the SSH agent be manipulated so that the desired key is selected automatically?
- Are there any documented workarounds (e.g., through
~/.ssh/configor agent forwarding) that reliably force the intended key without external scripts?