Andre Schütz - Learn. Think. Reflect - Tech developer
Make a SSH key available that is not the default one and combine with GIT SSH command

Make a SSH key available that is not the default one and combine with GIT SSH command

If you want to add another SSH key to the current shell session that is not the default one, you can do the following.

Export the additional key to the GIT SSH command to have it in scope for the current session.

export GIT_SSH_COMMAND="ssh -i ~/.ssh/filename"

Add the SSH key to the current shell session.

ssh-add ~/.ssh/filename

Besides the former command, you can still add the default ssh key with.

ssh-add

Leave a Reply