-
Git: using different SSH keys in your repos
Posted on 3 Oct 2024 - 21:47
Git: using different SSH keys in your repos When working with different projects and especially if you are a contractor that interacts with multiple clients, a common situation is that you have to access gitlab, bitbucket, github or other git cloud service with different credentials, usually to maintain access to other repositories while using an ssh-key that’s specific for a client. Generating the key pair If you haven’t generated a key yet, use the ssh-keygen command in git-bash. This generates public and private keys, by default in c:/Users/your_username/.ssh/. Make sure you specify a name for your new key that doesn’t overwrite any of the ones that are present in the .ssh folder. In this example our key is called id_rsa_second. If you don’t know how to add the generated public to your bitbucket account, see how to Set up personal SSH keys on Windows in Bitbucket Cloud.