Windows GitBash解决Github添加密钥时提示Key is already in use的问题

通过添加多密钥实现

  • ssh-agent bash
  • ssh-keygen -t rsa -C 'xx1' -f ~/.ssh/id_rsa_xx1
  • ssh-keygen -t rsa -C 'xx2' -f ~/.ssh/id_rsa_xx2
  • ssh-add id_rsa_xx1
  • ssh-add id_rsa_xx2

vim ~/.ssh/config

shell 复制代码
Host github_xx1
 HostName github.com
 User git
 IdentityFile ~/.ssh/id_rsa_xx1
Host github_xx2
 HostName github.com
 User git
 IdentityFile ~/.ssh/id_rsa_xx2
  • ssh -T -ai ~/.ssh/id_rsa_xx1 git@github_xx1
  • ssh -T -ai ~/.ssh/id_rsa_xx2 git@github_xx2
相关推荐
庐阳寒月28 分钟前
GitHub修炼法则:第一次提交代码教学(Liunx系统)
linux·github·嵌入式
高效匠人18 小时前
Galini AI 技术实现方案及 GitHub 开源库推荐
人工智能·开源·github
opentrending18 小时前
Github 热点项目 Qwen3 通义千问全面发布 新一代智能语言模型系统
人工智能·语言模型·github
油泼辣子多加1 天前
2025年04月29日Github流行趋势
github
N1CROWN1 天前
登录github失败---解决方案
github
@ZyuanZhang2 天前
github使用记录
github
Code_流苏2 天前
如何使用Git参与GitHub开源项目:入门全流程
git·开源·github·开源项目·入门学习
初级代码游戏2 天前
基于C++的IOT网关和平台1:github项目ctGateway
c++·物联网·github
我是哪吒2 天前
分布式微服务系统架构第124集:架构
后端·面试·github