[英]How to change Github local repo .git/config credentials to circumvent 403?
我正在尝试从设置了其他凭据的工作 PC 推送到我的远程 Github 存储库,这就是我得到的:
remote: Permission to *** denied to ***.
fatal: unable to access 'https://github.com/***': The requested URL returned error: 403
我尝试更改.gitconfig
但它没有帮助。
我怀疑 VS 代码以某种方式记住了工作凭据,但我找不到它在哪里。
在这里找到了答案。 最后,这与重置 VS 代码凭据无关。
在你的 repo 目录下找到.git/config
文件,在[remote "origin"]
部分下将 url 更改为
https://my-username@github.com/my-username/my-repo.git
到
ssh://git@github.com/my-username/my-repo.git
。
在那之后,我能够毫无问题地向上游推进。 我不太明白为什么,但它有效。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.