在一台电脑生成两份ssh密钥、公钥映射两个GitHub账号
在一台电脑生成两份ssh密钥、公钥映射两个GitHub账号
设置sshkey one
ssh-keygen -t rsa -C "xxxx@xxx.com"
设置sshkey two
ssh-keygen -t rsa -f ~/.ssh/id_rsa_2 -C "xxxx@xxx.com"
将.pub的内容设置到对应github上
新增文件config在.ssh文件夹下
配置内容
#default
Host gitlab.xxx.com
HostName gitlab.xxx.com
User git
IdentityFile ~/.ssh/id_rsa
#two
Host github.com
HostName github.com
User git
IdentityFile ~/.ssh/id_rsa_2

浙公网安备 33010602011771号