有没有一个命令可以退出git?我要把我的电脑交给别人,不想让git与我的账户绑定在终端上。
我遇到了同样的问题,上面的答案对我没有用,因为github是通过Windows凭据管理器而不是git bash来接收我的凭据的。
您可能需要检查Windows凭据管理器,然后在控制面板 > 用户帐户 > 凭据管理器 > Windows 凭据 > 通用凭据
下删除github条目。
git push
时,它还导致Git登录窗口加载,所以我怀疑是桌面客户端的原因。 - agm1984git config --global --unset credential.helper
非常好用。我无法像提到的那样在凭据管理器中找到登录信息。 - Ravimallya从~/.ssh
(或您存储它们的位置)中删除您的SSH密钥。
删除您的用户设置:
git config --global --unset user.name
git config --global --unset user.email
git config --global --unset credential.helper
或者你的所有全局设置:
git config --global --unset-all
也许与凭据存储相关的还有其他问题,但我总是使用SSH协议进行Git操作。
git config --global --unset-all
输出 error: wrong number of arguments, should be from 1 to 2
。 - Senjugit config --global --unset credential.helper
- devDeejay在Windows上尝试这个:
cmdkey /delete:LegacyGeneric:target=git:https://github.com
如果您在推代码时遇到任何问题(在Windows操作系统中),只需按照以下给出的步骤删除缓存的Git帐户:
我在公司环境中改过密码后,尝试使用 git pull
命令。
结果出现了这样的错误提示:remote: Invalid username or password.
有趣的是,以下命令并没有起作用:git config --global --unset credential.helper
我使用 Windows-7 操作系统,于是我打开控制面板 -> 凭据管理器 -> 通用凭据。
在凭据管理器中的清单里,删除与 git 相关的行项目。
删除之后,回到 GitBash,再次执行 git pull 命令会提示您输入凭据信息的对话框。
由于使用了其他凭据登录,我无法克隆存储库。
为了切换到另一个用户,我执行了以下操作:
git config --global --unset user.name
git config --global --unset user.email
git config --global --unset credential.helper
然后我使用https URL进行克隆,它要求输入凭据并且成功了。
~/.gitconfig
),所以我不得不将本地存储库文件夹重命名(以避免丢失本地更改),然后再次 git clone
远程存储库……
git
实际上没有"登录"或"注销"的概念。如果你没有登录到某个东西,通常也无法注销它。 - user554546