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
相关推荐
skywalk81632 小时前
github创建项目后,应该用main还是master作为默认branch?
git·github
正经教主3 小时前
【Git】Git07:GitHub desktop使用教程【可选】
git·github
CoderJia程序员甲4 小时前
GitHub 热榜项目 - 日榜(2025-11-20)
ai·开源·大模型·github·ai教程
JinSo20 小时前
Ultracite:为 AI 时代打造的零配置代码规范工具
前端·javascript·github
uhakadotcom20 小时前
Next.js 从入门到精通(1):项目架构与 App Router—— 文件系统路由与目录结构全解析
前端·面试·github
x***58701 天前
GitHub星标10万+的Redis项目,使用教程
数据库·redis·github
九夜1 天前
基于 .ibd 文件恢复 MySQL 数据全流程
后端·github
油丶酸萝卜别吃1 天前
GitHub 上查找中国乡镇经纬度范围数据的开源项目
git·github
郭小铭1 天前
React Suite v6:面向现代化的稳健升级
react.js·前端框架·github
小莫分享1 天前
Github Action 一键部署HTML 静态服务
前端·html·github