We have multiple GitHub Repositories. We are switching to SSO (Single Sign on). When using a Jenkins job that uses the Git plugin, we have different credentials for for each repository (you cannot use the same deploy key for more than one repository). This is working successfully.
When I am logged on to the build system (using my corp login thru SSO), and executing git.exe in a command window, or thru TortoiseGit (not using Jenkins), I can move the correct .SSH folder\keys (for the repository that I wish to access), to my user profile, and that works.
Some of the Jenkins jobs do not use the Git plugin. Those jobs access multiple GitHub repositories, so we have seperate Jenkins steps that use the Windows Batch Command, and access the GitHub repositories using git.exe.
It is unclear to me as to how to pass the correct SSH key for the particular repository, on the command line, as I am not logged into the system at this point (my SSO login does not kick in), and Jenkins is executing. Where do I put the .SSH folder for the particular repository that I wish to access (someplace in the GIT install folder, or the Jenkins install folder), or is the information somehow pass on the command line to Git?