Android Studio 清除GitHub账号密码

如果你的电脑本来就有.gitconfig文件, 找到下面这句话删除,保存退出。

[credential]   helper = xxx

这个时候输入命令

git config credential.helper

查看本机的credential 是否已经被清空。

如果输入了 git config credential.helper 命令之后还是出现了osxkeychain, store 或者 cache 等,说明 git 的配置还是没有被清空,我参考了stackOverFlow上这个问题 有人给了这样一个命令查看 credential.helper 所在的文件目录(可能一个电脑上有多个.gitconfig文件),

git config --show-origin --get credential.helper 
file:/Applications/Xcode.app/Contents/Developer/usr/share/git-core/gitconfig    osxkeychain

如果你的Mac上还有Xcode的话,那么Xcode中还会有一个.gitconfig文件,找出他然后打开,清空[credential]。

再次输入

git config credential.helper 

如果没有任何反应,那么 credential 就是已经清空了

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容