草庐IT

git - 错误(internetKeychainItemForServer :withUsername:path:port:protocol:) - The specified item could not be found in the keychain

coder 2023-06-24 原文

当我尝试使用 Sourcetree 将我的代码推送到 github 时出现以下错误:

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 上用钥匙串(keychain)做了一些事情,从那时起我就无法在 github 上推送任何东西。

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

最佳答案

我遇到了完全相同的问题。 ssh 代理似乎以某种方式丢失了我的凭据。当我尝试使用 terminal 列出我所有的 ssh key 时,我意识到了这一点:

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

所以我跑了

$ ssh-add ~/.ssh/my_rsa_key

我输入了 key 的密码。然后问题就消失了。

所以,我不知道我的 ssh 代理为什么或如何突然丢失它的 key ,但如果这与你遇到的问题相同,你可以通过使用 ssh 添加回 ssh key 来解决 -添加命令。

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

关于git - 错误(internetKeychainItemForServer :withUsername:path:port:protocol:) - The specified item could not be found in the keychain,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26003538/

有关git - 错误(internetKeychainItemForServer :withUsername:path:port:protocol:) - The specified item could not be found in the keychain的更多相关文章

随机推荐