Git credential helper - update password

前端 未结 10 1442
遥遥无期
遥遥无期 2020-12-07 08:21

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

相关标签:
10条回答
  • 2020-12-07 09:03

    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.

    0 讨论(0)
  • 2020-12-07 09:05

    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 with 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.

    0 讨论(0)
  • 2020-12-07 09:06

    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.

    0 讨论(0)
  • 2020-12-07 09:09

    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.

    0 讨论(0)
  • 2020-12-07 09:22

    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 PanelCredential ManagerGeneric 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
    
    0 讨论(0)
  • 2020-12-07 09:26

    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!!

    0 讨论(0)
提交回复
热议问题