2014-09-23 23 views
15

我碰到下面的错误,而我试图把我的代码使用到GitHub上Sourcetree发现:错误(internetKeychainItemForServer:withUsername:路径:端口:协议:) - 指定的项目不能在钥匙串

Pushing to http://github.myOrg.com/my-repo/my-proj.git 
2014-09-23 13:05:20.500 git-credential-sourcetree[6744:507] Error (internetKeychainItemForServer:withUsername:path:port:protocol:) - The specified item could not be found in the keychain. 
remote: Permission to ion-my-repo/my-proj.git denied to my-user-id. 
fatal: unable to access 'http://github.myOrg.com/my-repo/my-proj.git/': The requested URL returned error: 403 

当我打推,sourcetree问我要我的密码我的帐户相关:

Password required 
For user my-user-id on host github.myOrg.com 

所以看起来sourcetree知道什么是我的用户ID,它只是需要访问我的github帐户的密码。我能够使用sourcetree提取内容,并且不会向我索取我的凭据。我也能够推动这个项目,但最近我的系统管理员在我的Mac上用钥匙链做了一些事情,从那时起我无法在github上推送任何东西。

以前有没有人遇到过这个问题?

+0

我手动将证书添加到钥匙串,这似乎工作。 – 2014-09-24 15:36:40

+0

你能告诉我们吗? – 2014-10-22 07:21:51

+0

在钥匙串中:在'密码'类别中添加'bitbucket.org'项。 – 2014-11-06 12:25:33

回答

14

我有完全相同的问题。看起来,代理不知何故失去了我的凭据。我意识到,当我试图使用terminal列出我所有的SSH密钥:

$ ssh-add -l 
> The agent has no identities. 

于是我就

$ ssh-add ~/.ssh/my_rsa_key 

我输入密码我的钥匙。问题就消失了。

所以,我不知道为什么我的ssh代理突然失去了它的密钥,但如果这是你遇到的同样的问题,你可以通过使用ssh-add命令添加ssh密钥来解决。

这可能是有许多不同原因和解决方案的问题之一,我只是为我的案例提出一个解决方案。

+0

这对我有用!奇怪的是,如果我打开“钥匙串访问”并搜索“ssh”,我可以在那里看到钥匙。它实际上是没有它的ssh代理。 – GabrielOshiro 2016-04-11 03:30:39

相关问题