如何在Windows中注销Git Bash控制台? [英] How to sign out in Git Bash console in Windows?

查看:172
本文介绍了如何在Windows中注销Git Bash控制台?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Windows上使用Git,版本为2.9.2.windows.1。



我在一个存储库项目上工作,当我进行推送时,它要求我输入我的Github用户名和密码。我输入了我的Github用户名和密码来更新该项目。



在我的下一步中,它不再要求我的用户名和密码。我对该项目的所有修改都会更新。



看起来我的用户名和密码是保存的。我怎么摆脱他们?



我如何退出?



我试过了

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

但他们不会让我退出。



我想清除我的登录信息,以便下次推送时,它会再次要求我输入用户名和密码。






我找到了我的解决方案(感谢VonC):

b

转至:控制面板 - >用户帐户 - >管理您的凭据 - > Windows凭据 - >通用凭证下有一些凭据与Github相关,点击它们并点击删除。



它将我签出,所以下次我推送时,它会要求我输入用户名和密码。

user.name 和 user.email无关解析方案 / code> git config。



第二,与旧回答相比从git中移除凭证最新的Git for Windows 使用 Git Credential Manager (Git 2.9 .2 => GCM 1.5.0 )。

  git config --global credential.helper manager 

检查你的配置( git config -l <​​/ code>)并查看manager是否在那里注册。



自v1.3.0(2016年4月)开始,它有一个删除命令以清除证书

  git凭证管理器删除< url> 






如果git config credential-manager返回store,那么Git使用存储模式,它将证书保存到磁盘上的纯文本文件中,并且它们永不过期。

 键入%USERPROFILE%\.git-credentials 

我会从配置中删除特定的凭证助手,因为它以纯文本形式存储凭证。 OP Lord Rixuel 实际上证实了


我看到管理您的凭据选项,我出于好奇点击它,然后点击Windows凭据,在Generic Cred entials,有 git:github.com ,我点击它并且有删除选项。我点击删除。

当我执行git push时,它会再次询问我的用户和我的密码。正是我想要注销时想要的。



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

解决方案

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.

这篇关于如何在Windows中注销Git Bash控制台?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆