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

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