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
相关推荐
lpfasd1231 天前
2026年第24周科技社区趋势周报
github
今夕资源网1 天前
github开源 网页在线音频转文本工具 node.js+html源码
github·音频转文本·音频转字幕·音频转srt·音频转srt字幕文件·音频转lrc·音频转txt
得要找到一束光1 天前
git详细命令
git·github
LeahDizon1 天前
AI Coding 协作实践方案
程序员·github·代码规范
2601_961875241 天前
花生十三公考课程|网课|视频
数据库·windows·git·svn·eclipse·github
带娃的IT创业者1 天前
GitHub 热门: coleam00/Archon —— 当 AI Agent 学会自我进化
人工智能·github·开源项目·ai agent·智能体·自我进化
lpfasd1231 天前
2026年第24周GitHub趋势周报
github
江畔柳前堤1 天前
github实战指南03-Pull Request 全流程实战
开发语言·人工智能·python·深度学习·github·word
EleganceJiaBao1 天前
【Git】Git reset 完整指南:真正理解 HEAD、暂存区与工作区
git·github·reset
逛逛GitHub1 天前
不要错过这 18 个本周 YYDS 的 GitHub 开源项目。
github