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
相关推荐
小怪兽会微笑4 分钟前
如何上传github(解决git的时候输入正确的账号密码,但提示认证失败)
git·github
松哥_ai自动化3 小时前
从抓包GitHub Copilot认证请求,认识OAuth 2.0技术
github·copilot
qianmoQ11 小时前
GitHub 趋势日报 (2025年07月15日)
github
handsomestWei11 小时前
GitHub Jekyll博客本地Win开发环境搭建
github·jekyll·blog博客·windows开发环境
DogDaoDao14 小时前
GitHub开源轻量级语音模型 Vui:重塑边缘智能语音交互的未来
大模型·github·音视频·交互·vui·语音模型·智能语音
一小池勺15 小时前
🚀 Git 如何让文件存在于远程仓库却不被本地追踪?
git·github
小华同学ai15 小时前
惊喜! Github 10k+ star 的国产流程图框架,LogicFlow 能解你的图编辑痛点?
前端·后端·github
mortimer15 小时前
为 Index-TTS 打造一个开箱即用的 Windows 整合包:从环境隔离到依赖难题的解决
人工智能·python·github
Cyan_RA916 小时前
写译 — 我靠!短进程优先调度算法究竟是怎么一回事?
面试·github·代码规范
Albert_Lsk21 小时前
【2025/07/16】GitHub 今日热门项目
人工智能·开源·github·开源协议