多个git帐户和ssh密钥 [英] multiple git accounts and ssh key

查看:55
本文介绍了多个git帐户和ssh密钥的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个个人github帐户,可以在Visual Studio(团队资源管理器)上正常工作.现在,我的老板给了我他们的帐户,而我的Visual Studio一直都在引用旧帐户.它给了我以下错误:

I had a personal github account that was working fine with Visual Studio (Team Explorer). Now my employer gave me their account and all the time my Visual Studio refers to the old one. It gives me the following error:

发生错误.详细消息:libgit2引发了错误.类别=净(错误).响应状态代码未指示成功:404(未找到).

An error occurred. Detailed message: An error was raised by libgit2. Category = Net (Error). Response status code does not indicate success: 404 (Not Found).

所以我在Windows凭据管理器中添加了另一个帐户.

So i added another account in Windows Credential manager.

现在它仍然无法正常工作,然后我看到了这段视频:

Now it still didnt work, then i saw this video: https://code.tutsplus.com/tutorials/quick-tip-how-to-work-with-github-and-multiple-accounts--net-22574

所以我下载了腻子并生成了第二个ssh密钥(我不知道第一个在哪里!!)并将其链接到新的github帐户.现在它要求我在此公钥中添加一个身份.ssh-add〜/.ssh/sshkey2

So i downloaded putty and generated a second ssh key (i dont know where the first one is!!) and linked it to the new github account. Now it asks me to add an identity to this public key. ssh-add ~/.ssh/sshkey2

这给了我无法打开与您的身份验证代理的连接"

which gives me "Could not open a connection to your authentication agent"

当我尝试使用列出所有公钥时ls -al〜/.ssh

also when i try to list all public keys using ls -al ~/.ssh

它给了我ls:无法访问"/c/Users/spadmin/.ssh":没有此类文件或目录

it gives me ls: cannot access '/c/Users/spadmin/.ssh': No such file or directory

我的公钥也保存为.txt文件而不是.pub文件

also my public key is saved as a .txt file not as a .pub file

我可能会缺少什么?

推荐答案

我在这里找到了答案我不得不做

eval ssh-agent -s

ssh-add

并输入完整位置c:/users/spadmin/.ssh/xyz.ppk

and type full location c:/users/spadmin/.ssh/xyz.ppk

这篇关于多个git帐户和ssh密钥的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆