生成秘钥
打开git bash
$cd~/.ssh # 切换到C:\Users\Administrator\.ssh
ssh-keygen -t rsa -C"mywork@email.com" # 新建工作的SSH key
# 设置名称为id_rsa_work
Enter fileinwhichto save the key (/c/Users/Administrator/.ssh/id_rsa): id_rsa_work
在ssh文件夹下创建config文件
# 建一个github别名,新建的帐号使用这个别名做克隆和更新
Host git.coding.net
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa_work
引用文章
http://www.cnblogs.com/zichi/p/4704824.html
https://coding.net/help/doc/git/ssh-key.html
网友评论