If we want to use different authentication keys for a particular Git repo, we can edit the config
file of the repo and add the sshCommand
setting.
Navigate to the repository’s Git configuration directory:
|
|
In the folder there’s a file called config
. We are interested in the core
section. To use a particular SSH key for Git, we would write the command as shown below. Replace the name of the key file with your own.