Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
523 views
in Technique[技术] by (71.8m points)

github - How do I sign out in the 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 my next push, it doesn't ask for my username and password any more. All my modifications for the project are updated.

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

Question&Answers:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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 (Microsoft account). Under Windows Credentials, remove the GitHub login details and try Push again. You will be prompted for a GitHub ID and password explicitly. Once we login that gets stored as a personal access token for Git push.

GitHub credentials


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...