I\'m currently using GitHub over HTTPS and have the latest version of Git installed (1.9.0) along with the Git credential helper on Windows 7.
On setting up my envir
Just cd
in the directory where you have installed git-credential-winstore. If you don't know where, just run this in Git Bash:
cat ~/.gitconfig
It should print something looking like:
[credential]
helper = !'C:\\ProgramFile\\GitCredStore\\git-credential-winstore.exe'
In this case, you repository is C:\ProgramFile\GitCredStore. Once you are inside this folder using Git Bash or the Windows command, just type:
git-credential-winstore.exe erase
host=github.com
protocol=https
Don't forget to press Enter twice after protocol=https
.
None of the current solutions worked for me with git bash 2.26.2. This should work in any case if you are using the windows credential manager.
One issue is the windows credential manager runs for the logged user. In my case for example, I run git bash with right click, run as admin. Therefore, my stored credentials are in a credentials manager which I can't access with the windows GUI if I don't login to windows as admin.
To fix this:
cmdkey /list
. Your old credentials should appear here, with a part that reads ...target:xxx...cmdkey /delete:xxx
, where xxx is the target from the previous lineIt should confirm you that your credentials have been removed. Next time you do any operation in git bash that requires authentication, a popup will ask for your credentials.
It seems to me that the answers here are outdated. For me under Windows 10 and Git 2.15.0 this did the job:
git credential reject
protocol=https
host=github.com
<Empty line here>
And then to set the new username & password:
git credential fill
protocol=https
host=github.com
<empty line here>
After this, if the credentials now work on the desired target host, we should use git credential approve
-as mentioned in typical use of Git credentials (step 4)- to tell the credential helpers to mark the credentials as approved and reuse them in future connections.
FWIW, I stumbled over this very same problem (and my boss too, so it got more intense).
The instant solution is to delete or fix your Git entries in the Windows Credential Manager. You may have a hard time finding it in your localized Windows version, but luckily you can start it from the good old Windows + R run dialog with control keymgr.dll
or control /name Microsoft.CredentialManager
(or rundll32.exe keymgr.dll, KRShowKeyMgr
if you prefer the classic look). Or put this in a batch file for your colleagues: cmdkey /delete:git:http://your.git.server.company.com
.
In Microsoft's Git Credential Manager this is a known issue that may be fixed as soon as early 2019 (so don't hold your breath).
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.
None of these answers ended up working for my Git credential issue. Here is what did work if anyone needs it (I'm using Git 1.9 on Windows 8.1).
To update your credentials, go to Control Panel → Credential Manager → Generic Credentials. Find the credentials related to your Git account and edit them to use the updated password.
Reference: How to update your Git credentials on Windows
Note that to use the Windows Credential Manager for Git you need to configure the credential helper like so:
git config --global credential.helper wincred
If you have multiple GitHub accounts that you use for different repositories, then you should configure credentials to use the full repository path (rather than just the domain, which is the default):
git config --global credential.useHttpPath true
Solution using command line for Windows, Linux, and MacOS
If you have updated your GitHub password on the GitHub server, in the first attempt of the git fetch/pull/push
command it generates the authentication failed message.
Execute the same git fetch/pull/push
command a second time and it prompts for credentials (username and password). Enter the username and the new updated password of the GitHub server and login will be successful.
Even I had this problem, and I performed the above steps and done!!