gitgit-for-windows

Why does Git for Windows helper = manager not work on new machine?


I was running Git for Windows 2.37.1.windows.1 just fine on a Windows 10 machine. I've been updating Git for Windows on that old machine for years. My ~/gitconfig file contained:

[credential]
    helper = manager

I installed a clean Windows 10 on a new machine, and ran the exact same executable on the new machine to install Git. git --version correctly shows git version 2.37.1.windows.1.

I tried to access a Bitbucket secure repository, and it popped up an authentication dialog (not surprising), but on the command line it said:

git: 'credential-manager' is not a git command. See 'git --help'.

The most similar command is
        credential-manager-core

I realize there are several Stack Overflow questions, one of them saying to remove the [credential] section, one of them saying to change manager to manager-core, and yet another saying to run git credential-manager-core configure, etc.

But those are not my main question. Sure, I can spend half the day trying all these different commands and combinations trying to get Git working again.

My central question here is this: if the same version of Git for Windows worked on the old machine, why doesn't the exact same version of Git installed on the new machine work with the exact same .gitconfig? What is different? What did not get configured when I ran the Git for Windows installation executable on the new machine?


Solution

  • I'm going to take a stab at what is going on. If I run git credential-manager-core --version on each machine, it returns the same result, so Git Credential Manager Core seems indeed to be installed on both systems. But in reading Git Credential Manager Core: Building a universal authentication experience it appears that before there was Git Manager Core, there was just Git Manager.

    So I'm guessing that on the old machine Git originally used Git Manager. Eventually the newer versions of Git preferred Git Manager Core, but they continued to use Git Manager (which probably had been installed on my old machine via a previous Git version) because it was still set that way in .gitconfig.

    But on the new machine the latest Git version only installed Git Manager Core by default, not Git Manager. As my .gitconfig still referenced the old Git Manager, it couldn't find it as it hasn't been installed (and the installer saw no reason to install it because the installer probably didn't read the .gitconfig closely).

    I fixed the problem by changing manager to manager-core in .gitconfig:

    [credential]
        helper = manager-core
    

    Update for Git 2.39.1.windows.1: Now they are saying that "Git Credential Manager Core" was renamed to "Git Credential Manager" but that the executable for a while was left as git-credential-manager-core but has now been changed to git-credential-manager. A new warning git-credential-manager-core was renamed to git-credential-manager appears using Git 2.39.1.windows.1. Changing helper = manager-core back to helper = manager in .gitconfig makes the warning go away, although the instructions recommend this:

    [credential]
        helper =
        helper = C:/Program\\ Files\\ \\(x86\\)/Git\\ Credential\\ Manager/git-credential-manager.exe
    

    This is confusing, to say the least.