user/repo的权限被拒绝



我通过sudo apt install git安装了git。然后我设置我的git配置git config --global user.name "<usermame>"git config --global user.email "<email@email.com>"

我在<username>下创建了一个公共存储库,并使用HTTPS将它克隆到我的本地机器。

我在我的repo中做了一个小小的修改(编辑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

你怎么可能被拒绝访问你自己的公共存储库呢?

首先检查git config credential.helper返回的内容,以防它以某种方式缓存错误的凭据

如果返回xxx(用实际返回值替换'xxx'),尝试:

printf "protocol=httpsnsite=github.com"|git-credential-xxx get
# and
printf "protocol=httpsnsite=github.com"|git-credential-xxx erase

最新更新