在.ssh/config文件里这样设置:
Host RemoteServer
HostName remote-server.tld
User git
IdentityFile ~/.ssh/remoteserver_key
Host github.com
HostName github
User your-github-account
IdentityFile ~/.ssh/github_key
在.ssh/config文件里这样设置:
Host RemoteServer
HostName remote-server.tld
User git
IdentityFile ~/.ssh/remoteserver_key
Host github.com
HostName github
User your-github-account
IdentityFile ~/.ssh/github_key
转载于:https://my.oschina.net/zjzhai/blog/299675