gpt4 book ai didi

Windows 10 上的 Git - credential.helper 搞砸了

转载 作者:太空狗 更新时间:2023-10-29 14:10:19 28 4
gpt4 key购买 nike

我在 Windows 10 上使用 Git(可移植)。由于一些错误,我弄乱了用户名/密码及其缓存超时的配置。

我犯的错误是我还安装了适用于 Windows 的 Git(不可移植),我认为这是大多数问题的起点。但我不确定。现在我卸载了它,然后我又回到了 Git portable for Windows。

我曾经能够登录而不是每次都输入用户名/密码(对于 bitbucket)。现在我正在尝试重新设置 credential.helper 但我遇到了各种各样的问题。

1) 我经常收到这个消息:“git:'credential-cache' 不是 git 命令。”
不知道它来自哪里。以前我没有。

2) 我仍然被要求输入密码(不仅仅是第一次)。

3) 另外,我不确定 credential.helper 之前的值是多少。我猜它是 manager,但我在 SO 上发现还有 wincred。但是这个 wincred 看起来真的很老了。所以我想我应该将它设置为 manager

4) 顺便说一句,当我为 credential.helper 放置 manager 时,我得到一些奇怪的 bitbucket(类似浏览器) pop 窗口,我需要在其中输入我的用户名和密码(顺便说一句,在哪里这个 pop 窗口来自哪里?我没有从 bitbucket 安装任何东西?)。

enter image description here

但是当我输入用户名/密码时,它不接受它们并说:

fatal: HttpRequestException encountered.
An error occurred while sending the request.
git: 'credential-cache' is not a git command. See 'git --help'.

所以这次我需要从 cmd promt 输入它们,下次我需要在这个 pop 窗口中再次输入它们?!

我根本不想要这个 pop 窗口,我只想将我的用户名/密码保存在某个地方并缓存起来。我该怎么做?

在我的全局(Windows 用户级别)git 配置文件中,我有这个部分,但我不确定它是否正确。

[credential]
helper = cache --timeout=604800
helper = manager

最佳答案

你应该只有一个 credential.helper: manager。

尝试:git config -l --show-origin

对于您看到的每个 credential.helper,将其从其配置文件中删除。

然后输入:

git config --global credential.helper manager-core

(注2021:当前管理器为跨平台GCM -- Git Credential Manager Core项目)

最后,尝试 git push 到 bitbucket 存储库,重新输入您的用户名/密码(一次):这应该足够了。
虽然,check out this thread :

(20 June 2018): Recent changes to Bitbucket authentication has also meant that you must use your email (NOT your username) when logging in.
Currently, logging in with your username is still accepted but seems to cause several issues ranging from this repeated login prompt issue to the "too many login attempts" error when pushing

关于Windows 10 上的 Git - credential.helper 搞砸了,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52282755/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com