To set up specific SSH keys for specific git repositories there is the possibility to leverage an SSH config feature.
- your private key is ~/.ssh/special_id_rsa
- the SSH git repo “URI” firstname.lastname@example.org:username/reponame.git
You can setup/modify the ~/.ssh/config like this:
When you clone the repo use the following URL instead:
git clone email@example.com:username/reponame.git
In case the repo has been already cloned/initiated you got to modify .git/config:
url = firstname.lastname@example.org:username/reponame.git