Even if the user and host are the same, they can still be distinguished in ~/.ssh/config. For example, if your configuration looks like this:
Host gitolite-as-aliceHostName git.company.com
User git
IdentityFile /home/whoever/.ssh/id_rsa.alice
Host gitolite-as-bob
HostName git.company.com
User git
IdentityFile
/home/whoever/.ssh/id_dsa.bob
Then you just use gitolite-as-alice and gitolite-as-bob instead of the hostname in your URL:
git remote add alice git@gitolite-as-alice:whatever.git git remote add bob git@gitolite-as-bob:whatever.git原文地址: