Git多数据源配置

Git多数据源配置,第1张

Git多数据源配置

相关命令:

生成密钥:
ssh-keygen -t rsa -C "[email protected]"

多个仓库配置方法,在~/.ssh目录下创建config文件,内容如下:

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

# 配置gitlab.com
Host gitlab.com
    HostName gitlab.com
    IdentityFile C:\Users\wenc\.ssh\id_rsa_gitlab
    PreferredAuthentications publickey
    User knife
	
# situ	
Host gerrit.situdata.com
	HostName gerrit.situdata.com
	IdentityFile C:\Users\wenc\.ssh\id_rsa_situ
    PreferredAuthentications publickey
    User wenc
    # clone报错,添加的
	KexAlgorithms +diffie-hellman-group1-sha1
	HostKeyAlgorithms ssh-rsa
	PubkeyAcceptedKeyTypes ssh-rsa

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/langs/790553.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-05
下一篇 2022-05-05

发表评论

登录后才能评论

评论列表(0条)

保存