How to sign out in Git Bash console in Windows?

I’m using Git, on Windows, version 2.9.2.windows.1.

I work on a repository project and when I do a push, it asked me to enter my Github Username and Password. I entered both my Github Username and Password to update the project.

  • In what cases could `git pull` be harmful?
  • Crawling GitHub with JGit
  • Git not using SSH when doing 'git clone'
  • HOW TO Avoid git diff putting code block name in hunk header?
  • Maven plugin for versioning and minifying javascript
  • synchronize between 2 git repositories
  • In my next push, it doesn’t ask for my username and password anymore. All my modification for the project is updated.

    Looks like my username and password are “saved”. How do I “unsave” them?

    How do I sign out?

    I tried

    git config --global --unset user.name
    git config --global --unset user.email
    git config --global --unset credential.helper
    

    but they do not make me sign out.

    I want to clear my sign in so the next time I make a push, it asks me again to enter my username and password.


    I found my solution (Thanks to VonC):

    Go to: Control Panel -> User Accounts -> Manage your credentials -> Windows Credentials -> under Generic Credentials there are some credentials related to Github, click on them and click “Remove”.

    It signed me out so the next time I do a push, it asks me to enter my username and my password.

  • Compilation error - package com.google.gson not found in Redhat “Openshift” application
  • Private Git on OpenShift
  • Which commit has this blob?
  • Git - rollback to previous commit
  • How does a commit disappear from the log of one file?
  • How do I access a git repo on a windows share?
  • 4 Solutions collect form web for “How to sign out in Git Bash console in Windows?”

    First, user authentication has nothing to do with user.name and user.email git config.

    And second, compared to the old answer “remove credentials from git”, the latest Git for Windows uses Git Credential Manager (Git 2.9.2 => GCM 1.5.0).

     git config --global credential.helper manager 
    

    Check your config (git config -l) and see if “manager” is registered there.

    Since its v1.3.0 (April 2016), it has a delete command to purge credentials.

    git credential-manager delete <url>
    

    If git config credential-manager returns store, then Git uses the “store” mode, which saves the credentials to a plain-text file on disk, and they never expire.

    type %USERPROFILE%\.git-credentials
    

    I would remove that particular credential helper from the config, as it stores credentials in plain text.


    The OP Lord Rixuel actually confirms in the comments it is a native Windows Credential Manager function which provides automatically (Git or not) the credentials:

    I see the “Manage your credentials” option, I click on it out of curiosity, then I click on “Windows Credentials”, under “Generic Credentials”, there is “git:github.com“;, I click on it and there is the “Remove” option. I clicked Remove.

    When I do a git push, it asks again for my user and my password. Exactly what I want when I want to sign out.

    Add any username, password what aren’t your account, for example:

    git config --global user.name "foo"
    git config --global user.email "bar@example.com"
    

    For Windows 10, if your PC has a different login (a msft account) and github is on another login, if you go to control panel >> user accounts and search for credential manager you will see “Web Credentials” and “Windows credentials”. Github seems to be taking the default ID that is registered in the PC (msoft acct). Under windows credentials, remove the Github login details and try Push again, you will be prompted for github ID and password explicitly. Once we login that gets stored as a personal access token for git push.

    If you’re using multiple accounts (which is what brought me here) It’s more effective to unset the credential manager in the global git config and use the prompt screen.

    I was not able to find how to manage multiple accounts through the credential manager docs which are rather bare bones at the moment.

    Git Baby is a git and github fan, let's start git clone.