【Git】推送Github失败:remote: Permission to xxx/*.git denied to xxx

在github上,创建了token,推送代码报没权限

#设置token
git remote set-url origin <your.token>@github.com/<your.name>/hello-git.git

#推送代码
#git push -u origin main
remote: Permission to xxx/hello-git.git denied to xxx.
fatal: unable to access 'https://github.com/xxx/hello-git.git/': The requested URL returned error: 403

解决:在生成token时,需要勾选repo下面这些权限
【Git】推送Github失败:remote: Permission to xxx/*.git denied to xxx_第1张图片
(ps: 很久很久没用github了,一直用gitee,依稀记得之前是没有这些token权限功能的)

推送成功
【Git】推送Github失败:remote: Permission to xxx/*.git denied to xxx_第2张图片

你可能感兴趣的:(Git,开发工具,git,github)