Git credential helper - update password
GitGithubWindows 7-X64Change PasswordGit Credential-WinstoreGit Problem Overview
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 environment, I told git-credentials to permanently remember my username and password.
I've recently updated my GitHub password via the website and I'm now no longer able to push/pull/fetch, etc.
How I would go about updating my password on git-credentials helper on Windows 7?
Git Solutions
Solution 1 - Git
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 2 - Git
On my first attempt to Git fetch after my password change, I was told that my username/password combination was invalid. This was correct as git-credential helper had cached my old values.
However, I attempted another git fetch after restarting my terminal/command-prompt and this time the credential helper prompted me to enter in my GitHub username and password.
I suspect the initial failed Git fetch request in combination with restarting my terminal/command-prompt resolved this for me.
I hope this answer helps anybody else in a similar position in the future!
Solution 3 - Git
If you are a Windows user, you may either remove or update your credentials in Credential Manager.
In Windows 10, go to the below path:
Control Panel → All Control Panel Items → Credential Manager
Or search for "credential manager" in your "Search Windows" section in the Start menu.
Then from the Credential Manager, select "Windows Credentials".
Credential Manager will show many items including your outlook and GitHub repository under "Generic credentials"
You click on the drop down arrow on the right side of your Git: and it will show options to edit and remove. If you remove, the credential popup will come next time when you fetch or pull. Or you can directly edit the credentials there.
Solution 4 - Git
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!!
Solution 5 - Git
First find the version you are using with the Git command git --version
. If you have a newer version than 1.7.10, then simply use this command:
git config --global credential.helper wincred
Then do the git fetch
, then it prompts for the password update.
Now, it won't prompt for the password for multiple times in Git.
Solution 6 - Git
It seems to me that the answers here are outdated. For me using Git v2.15.0 issuing git credential reject
like 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.
Solution 7 - Git
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.
Solution 8 - Git
Working solution for Windows:
Control Panel > User Accounts > Credential Manager > Generic Credentials
Solution 9 - Git
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
.
Solution 10 - Git
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:
- Open a cmd as admin (or whatever user you run git bash with)
- Go to windows/system32
- Type
cmdkey /list
. Your old credentials should appear here, with a part that reads ...target:xxx... - Type
cmdkey /delete:xxx
, where xxx is the target from the previous line
It 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.
Solution 11 - Git
For Windows 10 it is:
Control Panel > User Accounts > Manage your Credentials > Windows Credentials, search for the git credentials and edit
Solution 12 - Git
If you have reset your password, hence you are getting Auth failure error in the git bash command window. (it does not show popup where you could enter new password).
In the git bash cmd window enter following command:
$ git config --global credential.helper wincred
Some times it will show popup to enter the new password
or Sometimes popup will be displayed when you are trying to do $git clone
..command