1台windows电脑,连2个git配置

我已有一个sshkey 了

widow,找到已有的.ssh文件夹打开,打开Git bash

 

再次执行: 

 ssh-keygen -t rsa -C [email protected] -f ~/.ssh/id_rsa_two

 

 

 新建文件

touch config

 

配置

# 配置github.com
Host github.com                 
    HostName github.com
    IdentityFile C:\\Users\\popfisher\\.ssh\\id_rsa_github
    PreferredAuthentications publickey
    User username1

# 配置git.oschina.net 
Host git.oschina.net 
    HostName git.oschina.net
    IdentityFile C:\\Users\\popfisher\\.ssh\\id_rsa_oschina
    PreferredAuthentications publickey
    User username2

 

测试:

 

参考链接:

https://www.cnblogs.com/godfeer/p/12214301.html

https://www.cnblogs.com/popfisher/p/5731232.html

https://jingyan.baidu.com/article/ab69b2708d09382ca7189f9b.html

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章