Remove credentials from Git

后端 未结 30 1817
不知归路
不知归路 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条回答
  •  梦毁少年i
    2020-11-21 10:50

    I faced the same issue as the OP. It was taking my old Git credentials stored somewhere on the system and I wanted to use Git with my new credentials, so I ran the command

    $ git config --system --list
    

    It showed

    credential.helper=manager
    

    Whenever I performed git push it was taking my old username which I set long back, and I wanted to use new a GitHub account to push changes. I later found that my old GitHub account credentials was stored under Control PanelUser AccountsCredential ManagerManage Windows Credentials.

    I just removed these credentials and when I performed git push it asked me for my GitHub credentials, and it worked like a charm.

提交回复
热议问题