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
相关推荐
保卫大狮兄5 小时前
2小时,我搭了一套仓库出入库管理系统:收货、领料、退料、库存全打通!
wms·github·仓库·入库
沙蒿同学5 小时前
不引 Ghostscript:我用纯 Go 给 PDF 做了一场「压缩手术」
前端·后端·github
wflynn10 小时前
GitHub 日榜趋势速报 | 2026-10-23
开源·github
miofly12 小时前
Anthropic开源MHS标准,让AI智能体直接操作实验室硬件
开源·github
m4Rk_12 小时前
【论文阅读】Agent记忆机制(109):MemComposer——用强化学习学会选哪些记忆、选多少以及怎样排序
论文阅读·人工智能·学习·开源·github
Orange Wu13 小时前
GitHub SSH 443 端口配置解决连接失败
github
左手吻左脸。14 小时前
新环境配置git
github
miofly14 小时前
GitHub 今日推荐|dquickts:能暂停、能存档的 QuickJS
开源·github
import_random14 小时前
[git]只有git,没有github, 如何工作
git·github
import_random14 小时前
[git]先创建远程仓库or先创建本地项目
git·github