我正在使用几个存储库,但最近我只在我们的内部存储库中工作,一切都很好。

今天我不得不提交并将代码推到另一个,但我遇到了一些麻烦。

$ git push appharbor master
error: The requested URL returned error: 403 while accessing https://gavekortet@appharbor.com/mitivo.git/info/refs?service=git-receive-pack
fatal: HTTP request failed

没有什么我能做的,这将再次带来密码输入。

我如何重置系统上的凭据,以便Git询问我该存储库的密码?

我试过:

Git配置——global——unset core.askpass

以便取消设置密码

Git配置凭证。Helper '缓存超时=1'

为了避免凭证缓存…

似乎什么都不管用;谁有更好的主意?


当前回答

对于Windows 10,转到下面的路径,

控制面板\用户帐户\凭证管理器

在这个位置会有两个标签,

2. Web证书。Windows凭据。

点击Windows凭据标签,在这里你可以看到你存储的github凭据, 在“一般证书”标题下。

你可以从这里删除这些,并尝试重新克隆-它会要求用户名/密码,因为我们刚刚从Windows 10系统中删除了存储的凭据

其他回答

重新输入:

$ git config credential.helper store

然后系统会提示您再次输入您的凭证。

警告

使用此帮助程序将未加密的密码存储在磁盘上

来源:https://git-scm.com/docs/git-credential-store

在我的Win 10上,找不到Windows凭据管理器和。git-credentials。 有效的方法是打开Git GUI并推送代码。然后它请求凭据,这也更新了我Git Bash缓存的密码。

这种方法对我来说是有效的,并且不受操作系统的影响。这有点笨拙,但很快,让我重新输入凭证。

只需找到您希望重新输入凭据的远程别名。

$ git remote -v 
origin  https://bitbucket.org/org/~username/your-project.git (fetch)
origin  https://bitbucket.org/org/~username/your-project.git (push)

复制项目路径(https://bitbucket.org/org/~username/your-project.git)

然后取下遥控器

$ git remote remove origin

然后再加回去

$ git remote add origin https://bitbucket.org/org/~username/your-project.git

请执行以下命令-

git config --global credential.helper cache

然后运行任何git命令,比如git pull,它会要求输入用户名和密码。输入详细信息,如果您想存储您的git凭据,请运行以下命令-

git config --global credential.helper store

当做一个'git拉'时,有同样的错误,这就是我如何修复它。

将repo更改为HTTPS 执行命令git config——system——unset credentials .helper 执行命令git config——system——add credential。辅助经理 测试命令git拉 在弹出的登录窗口中输入凭证。 Git拉取成功。