我目前正在通过HTTPS使用GitHub,并在Windows 7上安装了最新版本的Git(1.9.0)以及Git凭据帮助程序。
在设置环境时,我告诉git-credentials永久地记住我的用户名和密码。
我最近通过网站更新了我的GitHub密码,现在我不再能够推/拉/取等。
如何在Windows 7的git-credentials helper上更新我的密码?
我目前正在通过HTTPS使用GitHub,并在Windows 7上安装了最新版本的Git(1.9.0)以及Git凭据帮助程序。
在设置环境时,我告诉git-credentials永久地记住我的用户名和密码。
我最近通过网站更新了我的GitHub密码,现在我不再能够推/拉/取等。
如何在Windows 7的git-credentials helper上更新我的密码?
当前回答
如果你重置了你的密码,那么你会在git bash命令窗口中得到认证失败错误。(它不显示弹出窗口,你可以输入新密码)。
在git bash cmd窗口中输入以下命令:
$ git config --global credential.helper wincred
有时会弹出输入新密码的窗口 或者当您尝试执行$git克隆..命令时,有时会弹出窗口
其他回答
如果您是Windows用户,您可以在凭证管理器中删除或更新您的凭证。
Windows 10下,进入如下路径:
控制面板→所有控制面板项→证书管理器
或者在开始菜单的“搜索Windows”部分搜索“凭据管理器”。
然后在凭证管理器中,选择“Windows凭证”。
证书管理器将显示许多项,包括您的outlook和GitHub存储库下的“通用证书”
单击Git右侧的下拉箭头:它将显示编辑和删除选项。如果您删除,证书将在下次获取或拖动时弹出。或者你可以直接在那里编辑凭证。
在安装git-credential-winstore的目录下cd即可。如果你不知道在哪里,在Git Bash中运行这个:
cat ~/.gitconfig
它应该打印如下内容:
[credential]
helper = !'C:\\ProgramFile\\GitCredStore\\git-credential-winstore.exe'
在本例中,存储库是C:\ProgramFile\GitCredStore。一旦你使用Git Bash或Windows命令进入这个文件夹,只需输入:
git-credential-winstore.exe erase
host=github.com
protocol=https
不要忘记在protocol=https后按两次Enter。
Windows的工作解决方案:
控制面板>用户帐户>凭证管理器>通用凭证
这些答案最终都不能解决我的Git证书问题。如果有人需要的话,这里是有效的方法(我在Windows 8.1上使用Git 1.9)。
要更新您的凭证,请转到控制面板→凭证管理器→通用凭证。找到与Git帐户相关的凭据,并编辑它们以使用更新后的密码。
参考:如何在Windows上更新Git凭据
注意,要使用Git的Windows凭据管理器,你需要像这样配置凭据助手:
git config --global credential.helper wincred
如果你有多个用于不同存储库的GitHub帐户,那么你应该配置凭据以使用完整的存储库路径(而不仅仅是域,这是默认的):
git config --global credential.useHttpPath true
顺便说一句,我也遇到了同样的问题(我的老板也是,所以问题变得更严重了)。
即时的解决方案是删除或修复Windows凭据管理器中的Git条目。你可能很难在你的本地化Windows版本中找到它,但幸运的是,你可以从旧的Windows + R运行对话框中用控件keymgr.dll或控件/name Microsoft启动它。CredentialManager(或rundll32.exe keymgr.dll, KRShowKeyMgr,如果你更喜欢经典的外观)。或者把它放在你同事的批处理文件中:cmdkey /delete:git:http://your.git.server.company.com。
在微软的Git凭据管理器中,这是一个已知的问题,可能最快在2019年初就会修复(所以不要屏住呼吸)。
Update (2020-09-30): GCM4W seems to be more or less abandoned (last release more than a year ago, only one commit to master since then named, I kid you not, "Recreate the scalable version of the GCM Logo"). But don't despair, with Microsoft now going Core, there is a shiny new project called GCM Core, which seems to handle password changes correctly. It can be installed standalone (should be activated automatically, otherwise activate e.g. with git config --system credential.helper manager-core) but is also included in the current Git for Windows 2.28.0. For more information about it, see this blog post.