2011/07/07

Choose SSH Key based on Hostname

Edit ~/.ssh/config:
Host Home
 Hostname=192.168.168.100
 IdentityFile=~/.ssh/id_rsa.home
Host GitHub
 Hostname=github.com
 IdentityFile=~/.ssh/id_rsa.github

Then, set up your repositories respectively
git remote add home ssh://user@Home/path/to/repo
git remote add github git://user@GitHub/path/to/repo