I currently use the Windows SSH agent, which holds several private keys that all work perfectly when accessed via the CLI. The issue arises when I try to clone repositories using a specific corporate GitLab key; the destination path has been modified—using gitlab@gitlab.example instead of the standard git@gitlab—and I believe this prevents SourceTree from recognizing both the SSH agent and the repository URL I want to clone.
In SourceTree, I have selected the "OpenSSH" option with the "automatically start SSH agent" setting disabled, as I already have the Windows SSH agent running at all times. Currently, the only way it works is if I manually add the SSH key and authenticate every single time I open the application.
Is there really no other way to automate the authentication? Or is there a way to ensure SourceTree uses the Windows SSH agent instead of its own?
I have attached the error message below:
Command: git -c diff.mnemonicprefix=false -c core.quotepath=false --no-optional-locks ls-remote gitlab@gitlab.example.com:example/of/error/bla/bla-bla.git
Output:
Error: gitlab@gitlab.example.com: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
For any other doubts about this problem becasue a lack of context don't doubt to reply me as many times as needed.
If any further context is needed, please feel free to reply to this thread—don't hesitate to ask as many follow-up questions as necessary.
Thank you very much in advance.