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

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

bash 复制代码
#设置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下面这些权限

(ps: 很久很久没用github了,一直用gitee,依稀记得之前是没有这些token权限功能的)

推送成功

相关推荐
深耕AI1 小时前
【宝塔面板】监控、日志、任务与安全设置
安全·github
~~李木子~~7 小时前
通过git上传项目到码云和GitHub操作手册
git·gitee·github
songyuc9 小时前
【Git】请帮忙解释一下“git reset”
git·elasticsearch
AI分享猿11 小时前
雷池 WAF 免费版实测:企业用 Apache 搭环境,护住跨境电商平台
web安全·github·apache
whysqwhw12 小时前
kotlin-4
github
whysqwhw12 小时前
kotlin-3
github
whysqwhw13 小时前
kotlin-1
github
whysqwhw13 小时前
kotlin-2
github
Komorebi_999913 小时前
使用Git创建自己的分支的操作指南
git
CoderJia程序员甲15 小时前
GitHub 热榜项目 - 日榜(2025-11-09)
github