【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权限功能的)

推送成功

相关推荐
这周也會开心18 分钟前
通过ssh连接GitHub远程仓库
运维·ssh·github
不会写DN36 分钟前
用户头像文件存储功能是如何实现的?
java·linux·后端·golang·node.js·github
whysqwhw1 小时前
KNOI 架构详细分析报告
github
绝无仅有2 小时前
面试真实经历某商银行大厂计算机网络问题和答案总结
后端·面试·github
绝无仅有2 小时前
面试真实经历某商银行大厂系统,微服务,分布式问题和答案总结
后端·面试·github
唐青枫3 小时前
为什么 .gitignore 不生效?其实你忘了用 git rm --cached!
git
草梅友仁12 小时前
草梅 Auth 1.10.1 发布与浏览器自动化工具 | 2025 年第 42 周草梅周报
开源·github·自动化运维
CoderJia程序员甲16 小时前
GitHub 热榜项目 - 日榜(2025-10-18)
ai·开源·大模型·github·ai教程