Last active
December 25, 2015 18:39
-
-
Save lizzie/7021747 to your computer and use it in GitHub Desktop.
Multiple SSH Keys settings for different github account
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ more ~/.ssh/config | |
Host github.com_ls | |
HostName github.com | |
User lizziesky@gmail.com // 邮箱或者账户名 | |
IdentityFile ~/.ssh/id_rsa_ls | |
Host github.com | |
HostName github.com | |
User shengyan1985@gmail.com | |
IdentityFile ~/.ssh/id_rsa | |
// like https://gist.github.com/jexchan/2351996 | |
// 生成不同 ssh pub key, 添加到不同 github 账号 setting 的 ssh-key 中 | |
// github 上不同账号的不同库对另一个账号没有读写全限时, | |
$ git clone git@github.com_ls:sunsetsunrise/xxx.git 获取 lizziesky@gmail.com 账户下的仓库 | |
$ git clone git@github.com:lizzie/yyy.git 获取 shengyan1985@gmail.com 账户下的仓库 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment