Android Studio 上传GitHub 报错The requested URL returned error: 403

如果你的电脑本来就有.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 就是已经清空了



作者:its程
链接:https://www.jianshu.com/p/77b0340a02f3
來源:简书
简书著作权归作者所有,任何形式的转载都请联系作者获得授权并注明出处。

参考https://www.jianshu.com/p/77b0340a02f3

猜你喜欢

转载自blog.csdn.net/qq_36258441/article/details/81086021