Returning to a project that had lain fallow for several months, I found I was unable to push changes from my work in progress branch up to GitHub.

When I tried to push my branch, I got the following error:

C:\GitHub\wordtutor\
[feature/update-packages-dotnet6 +2 ~0 -0 !]
11:36:24 PS> git push --set-upstream origin feature/update-packages-dotnet6
remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead.
remote: Please see https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/ for more information.
fatal: Authentication failed for 'https://github.com/theunrepentantgeek/wordtutor.git/'

After reading the linked page I was somewhat confused as I already had the Git Credential Manager installed; manually setting up a personal access token (PAT) shouldn’t be necessary.

Instead of just failing authentication, I expected the Git Credential Manager to automatically reprompt for my credentials, including 2FA as required. This wasn’t happening.

Upgrading the Git Credential Manager to the latest version by updating Git For Windows to the latest version didn’t make any difference.

After following a number of dead-end leads, I ended up looking at my global .gitconfig file, found in my home directory (in my case, C:\users\Bevan).

Under the [credential] section, there was a duplicate helper setting … with a blank value …

[credential]
    helper =
    helper = C:/Program\\ Files/Git/mingw64/libexec/git-core/git-credential-manager-core.exe

That blank value looked dodgy … so after backing up my .gitconfig file, I removed the extra:

[credential]
    helper =
    helper = C:/Program\\ Files/Git/mingw64/libexec/git-core/git-credential-manager-core.exe

Then, I retried my push …

C:\GitHub\wordtutor\
[feature/update-packages-dotnet6 +2 ~0 -0 !]
11:36:36 PS> git push --set-upstream origin feature/update-packages-dotnet6
info: please complete authentication in your browser...
Everything up-to-date
Branch 'feature/update-packages-dotnet6' set up to track remote branch 'feature/update-packages-dotnet6' from 'origin'.

Success!

So if you are failing to authenticate automatically with GitHub (or any upstream repo host), you’re running on Windows, and the Git Credential Manager isn’t automatically prompting you for updated credentials, check your .gitconfig file.

Comments

blog comments powered by Disqus
Next Post
When are you done?  18 Apr 2022
Prior Post
Sharpen The Saw - August 2021  31 Jul 2021
Related Posts
Browsers and WSL  31 Mar 2024
Factory methods and functions  05 Mar 2023
Using Constructors  27 Feb 2023
An Inconvenient API  18 Feb 2023
Method Archetypes  11 Sep 2022
A bash puzzle, solved  02 Jul 2022
A bash puzzle  25 Jun 2022
Improve your troubleshooting by aggregating errors  11 Jun 2022
Improve your troubleshooting by wrapping errors  28 May 2022
Keep your promises  14 May 2022
Archives
November 2021
2021