我通过sudo apt install git安装了git。然后我设置我的git配置git config --global user.name "<usermame>"和git config --global user.email "<email@email.com>"
我在<username>下创建了一个公共存储库,并使用HTTPS将其克隆到我的本地计算机上。
我在我的存储库(编辑README.md)中做了一个很小的更改,然后继续提交。当我试着推动它时,我得到了
remote: Permission to <username>/<publicrepo>.git denied to <username>.
fatal: unable to access 'https://github.com/<username>/<repo>.git/': The requested URL returned error: 403
我使用了正确的用户名和正确的个人令牌。我在Ubuntu 20.04上运行
你怎么可能被拒绝访问你自己的公共存储库?
发布于 2021-08-29 05:26:07
首先检查git config credential.helper返回的内容,以防它以某种方式缓存错误的凭据
如果返回xxx (将'xxx‘替换为实际返回值),请尝试:
printf "protocol=https\nsite=github.com"|git-credential-xxx get
# and
printf "protocol=https\nsite=github.com"|git-credential-xxx erasehttps://stackoverflow.com/questions/68969910
复制相似问题