【问题标题】:git: 'credential-cache' is not a git command - Remove settinggit:'credential-cache' 不是 git 命令 - 删除设置
【发布时间】:2023-03-20 09:00:01
【问题描述】:

尝试在 Windows 7 上设置 git 凭据缓存后,我现在想放弃这个想法并从 git 中删除此错误消息和设置。

git: 'credential-cache' is not a git command.

This related question 展示了如何通过安装额外的软件来修复此错误,以使凭据缓存正常工作——但我希望一起删除此设置。

我该怎么做?

我尝试过: git config --global --remove-section credential-cache 及其变体。 它也不存在于我的 .git/config 文件中。

【问题讨论】:

  • 你在做什么来导致那个错误信息?
  • @greg-hewgill git pull 或 push

标签: git caching config


【解决方案1】:

我遇到了同样的错误,原因是从远程“feat_x”中拉出分支,我在本地仓库中创建了分支“feat_x”。这里的修复是从本地 repo 中删除分支并从远程再次拉它。

【讨论】:

    【解决方案2】:

    我遇到了同样的问题-

    $ git push
    git: 'credential-user.name' is not a git command. See 'git --help'.
    git: 'credential-user.email' is not a git command. See 'git --help'.
    git: 'credential---replace-all' is not a git command. See 'git --help'.
    

    所以我决定摆脱所有凭据缓存:

    git config --global -e
    

    这里你可以删除所有 helper 行 -

    [credential]
            helper = xxxx
    

    保存并重试:

    $ git push
    Everything up-to-date
    

    如果你想将你的 git 密码存储在本地电脑中,这样你就不需要每次都输入密码了,那么试试:

    git config --global credential.helper store
    

    这将添加:

    [credential]
            helper = store
    

    然后重试git push 并输入用户名和密码一次。在此之后,您将不再需要为您的 git pullgit push 命令提供用户名和密码。

    【讨论】:

      【解决方案3】:
      git config --system -e
      

      按“I”进行编辑;

      删除代码

      [credential]
      helper=xxxxxx
      

      按“Esc”关闭编辑器,输入“:wq”退出编辑器;

      【讨论】:

        【解决方案4】:

        我在 ubuntu 中修复了这个问题,只需在终端中输入以下命令即可。

        sudo git config --system --unset credential.helper manager
        

        这对我有用。

        【讨论】:

          【解决方案5】:

          我运行了git config --global -e,但它不包含任何与凭据相关的部分。

          但是,当我运行 git config -e 时,我确实发现有一个 [credential] 部分。

          以下命令为我解决了这个问题。

          git config --remove-section credential

          【讨论】:

          • 我怎样才能奖励你一些声望?这解决了一个可怕的问题!
          【解决方案6】:

          运行 git config --global -e 允许我从全局 git 配置中删除有问题的配置设置。

          [credential]
          helper = winstore
          

          【讨论】:

          • 确保检查您的本地(可能还有系统)配置 - git config -e 加载当前存储库的配置。您可以在多个地方定义凭证助手,这帮助我找出了我在特定存储库中定义的第二个助手。
          • 对于旧版本,winstore 或缓存可能无法正常工作。我使用[credential] helper = wincred 基于 [stackoverflow.com/a/11889392/922741] 和快乐的日子
          • @claudekennilol 大概他们删除了这些行(在 VIM 中,您可以在一行上按 'dd' 将其删除)并通过键入 :wq! 保存文件!
          【解决方案7】:

          我有同样的错误问题:

          $ git push -u origin master
          git: 'credential-cache' is not a git command. See 'git --help'.
          Branch master set up to track remote branch master from origin.
          Everything up-to-date
          

          所以我决定完全摆脱凭证缓存,并在 Git bash 中做到了:

          git config --global -e
          

          然后我找到了

          [credential]
              helper = cache
          

          并删除它,保存文件,然后我再次尝试结果是:

          $ git push
          Everything up-to-date
          

          所以错误消失了。

          【讨论】:

          • 谢谢。你能解释一下为什么会发生错误吗?
          【解决方案8】:

          只是重申 Bradley Flood 所说的正确,运行 git config --global -e 也对我有用,并且在此基础上扩展我删除的配置设置是:

              [credential]
              helper = winstore
          

          【讨论】:

            猜你喜欢
            • 2021-11-01
            • 2022-07-06
            • 2017-01-23
            • 2018-10-29
            • 2012-11-19
            • 2012-10-14
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            相关资源
            最近更新 更多