赞
踩
git config --global user.name "B"
git config --global user.email "D"
$ ssh -T git@github.com
#新建SSH key:
$ cd ~/.ssh # 切换到C:\Users\Administrator\.ssh
ssh-keygen -t rsa -C "cherrieliu@sohu-inc.com" # 新建工作的SSH key
# 设置名称为id_rsa_work
Enter file in which to save the key (/c/Users/Administrator/.ssh/id_rsa): id_rsa_work
然后在github的账户上把id_rsa_work.pub
文件复制到新的密钥上。
Host github.com
HostName github.com
User zhangyugege
IdentityFile ~/.ssh/id_rsa
Host work.com
HostName work.com
User cherrieliu@sohu-inc.com
IdentityFile ~/.ssh/id_rsa_woek
这样在github和公司私有仓库使用本地rsa的时候要,通过config文件的配置去选择性查找啦。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。