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” email@example.com:username/reponame.git
You can setup/modify the ~/.ssh/config like this:
When you clone the repo use the following URL instead:
git clone firstname.lastname@example.org:username/reponame.git
In case the repo has been already cloned/initiated you got to modify .git/config:
url = email@example.com:username/reponame.git