如何重置'git credential-osxkeychain'中存储的凭据? [英] How do you reset the stored credentials in 'git credential-osxkeychain'?

查看:931
本文介绍了如何重置'git credential-osxkeychain'中存储的凭据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经按照GitHub指示设置了我的帐户,并且可以克隆,但我无法远程推送。



当我做一个混帐推我得到了403错误。它具有正确的网址。我尝试了一个git credential-osxkeychain get来查看它给出的内容,并且打印出错误的凭据。



我相信发生了什么事是第一次对于凭据,我认为这是另一个应用程序问的问题,它把错误的。



我只需要重置它,以便它使用正确的钥匙串项目我的GitHub账户。



我试过:

  git凭证-sxkeychain擦除
git凭证-osxkeychain设置

程序从不给出任何提示。如果我没有做正确的事情,Set会说不好的输入。我试着把 password = password 等放进去,但是当我做一个get的时候,我仍然会得到旧的。



我无法弄清楚它们在哪里存储,因为它们不在.gitconfigure中。此外,最近没有可能的钥匙串项目。 (我在我的钥匙串中有几个GitHub帐户,并没有使用它们中的任何一个)。解决方案原来是解决方案这:

命令 git credential-osxkeychain 正在使用第一个 GitHub帐户条目在我的钥匙链中。这个人不是那个可以访问相关项目的人。

我通过触摸Keychain Access中的帐户解决了问题,以便更改日期(我想我只是更改了评论),现在它已成为最新的GitHub帐户它成为第一个返回到凭证-osxkeychain,因此一切正常。

对多个GitHub帐户的更好的支持形式会很好,但很可能大多数人只有一个主帐户,并且不会遇到这个问题。

I've followed the GitHub instructions for setting up my account, and I'm able to clone, but I'm unable to push remotely.

When I do a "git push" I get the 403 error. It has the correct URL. I tried a "git credential-osxkeychain get" to see what it was giving, and this prints out the wrong credentials.

I believe what happened is the first time it asked for the credentials, I thought it was another application asking, and it put the wrong ones in.

I just need to reset it so that it uses the correct keychain item for my GitHub account.

I've tried:

git credential-osxkeychain erase
git credential-osxkeychain set

The program never gives any prompts. Set will say "bad input" if I don't do the right thing. I tried putting in "password=password", etc., but then when I do a "get" I still get the old ones.

I can't figure out where these are being stored, as they are not in .gitconfigure. Further there are no recent keychain items that could be it. (I have several GitHub accounts in my keychain and it is not using any of them.)

解决方案

The solution turned out to be this:

The command git credential-osxkeychain was using the first GitHub account entry in my keychain. This one was not the one that had access to the projects in question.

I resolved the problem by touching the account in Keychain Access so that its date changed (I think I just changed the comment) and now that it became the most recent GitHub account it became the first one returned to credential-osxkeychain, and thus everything worked.

A better form of support for multiple GitHub accounts would be nice, but it is likely that most people only have one primary account and don't run into this problem.

这篇关于如何重置'git credential-osxkeychain'中存储的凭据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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