Github 多账户配置踩坑
- win10
按照参考文档一步步走,踩了一些坑如下
参考文档
踩坑
- win10 默认关闭 OpenSSH Authentication Agent 服务,需要手动打开并运行
unable to start ssh-agent service, error :1058
ssh-add returns with: "Error connecting to agent: No such file or directory"
Starting ssh-agent on Windows 10 fails: "unable to start ssh-agent service, error :1058"
- win10
ssh-add -K “private-key”
会报错,且 window power shell 报错消息奇葩,无法检索到有效信息
Cannot download keys without provider
用 git bash 运行 ssh-add -K “private-key”
,报错消息更明朗
Unable to load resident keys: incorrect passphrase supplied to decrypt private key
检索后发现 issue 中高赞回复指出 win10 不需要参数 K
,感动,点赞 + 撒花
后面翻文档发现有额外的链接指向不同系统说明(仔细打副本看来也能解决这个 bug)
Generating a new SSH key and adding it to the ssh-agent - GitHub Docs
成功
- 配置 config
- 下载仓库
git clone git@github.com-{your-username}:{owner-user-name}/{the-repo-name}.git [e.g.] git clone git@github.com-rahul-personal:rahul-personal/TestRepo.git
- 配置 local config
git config --local user.email "manta@zkcross.org" git config --local user.name "manta0228"
- 配置 remote
git remote add zkcross git@github.com-manta0228:zkcrossteam/ZKC-Tutorial.git git remote add zkcross git@github.com-manta0228:zkcrossteam/ZKC-SDK.git
番外
刻舟求剑
ssh-add -K
K 参数的意义?@水歌
The
-K
option is in Apple's standard version ofssh-add
, which stores the passphrase in your keychain for you when you add an ssh key to the ssh-agent. If you have installed a different version ofssh-add
, it may lack support for-K
.