Remove credentials from Git

后端 未结 30 1668
不知归路
不知归路 2020-11-21 10:13

I\'m working with several repositories, but lately I was just working in our internal one and all was great.

Today I had to commit and push code into other one, but

相关标签:
30条回答
  • 2020-11-21 10:35

    If you want git to forget old saved credentials and re-enter username and password, you can do that using below command:

    git credential-cache exit
    

    After running above command, if you try to push anything it will provide option to enter username and password.

    0 讨论(0)
  • 2020-11-21 10:36

    Need to login with respective github username and password

    To Clear the username and password in windows

    Control Panel\User Accounts\Credential Manager

    Edit the windows Credential

    Remove the existing user and now go to command prompt write the push command it shows a github pop-up to enter the username/email and password .

    Now we able to push the code after switching the user.

    0 讨论(0)
  • 2020-11-21 10:36

    On Windows, at least, git remote show [remote-name] will work, e.g.

    git remote show origin
    
    0 讨论(0)
  • 2020-11-21 10:37

    You have to update it in your Credential Manager.

    Go to Control Panel > User Accounts > Credential Manager > Windows Credentials. You will see Git credentials in the list (e.g. git:https://). Click on it, update the password, and execute git pull/push command from your Git bash and it won't throw any more error messages.

    0 讨论(0)
  • 2020-11-21 10:37

    In case Git Credential Manager for Windows is used (which current versions usually do):

    git credential-manager clear
    

    This was added mid-2016. To check if credential manager is used:

    git config --global credential.helper
    → manager
    
    0 讨论(0)
  • 2020-11-21 10:39

    This error appears when you are using multiple Git accounts on the same machine.

    If you are using macOS then you can remove the saved credentials of github.com.

    Please follow below steps to remove the github.com credentials.

    1. Open Keychain Access
    2. Find github
    3. Select the github.com and Right click on it
    4. Delete "github.com"
    5. Try again to Push or Pull to git and it will ask for the credentials.
    6. Enter valid credentials for repository account.
    7. Done

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