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

推送成功

相关推荐
Kiri霧2 小时前
Git入门
git
Nejosi_念旧3 小时前
git报错解决:ssh: connect to host github.com port 22: Connection refused
git·ssh·github
你的人类朋友3 小时前
说说git的变基
前端·git·后端
程序设计实验室4 小时前
在Windows上将git与ssh-agent搭配使用,再也不用输入git密码了
windows·git
Clownseven4 小时前
Gitea Webhook教程:实现git push后自动部署更新网站 (CI/CD入门)
git·ci/cd·gitea
兔老大RabbitMQ6 小时前
git pull origin master失败
java·开发语言·git
大千AI助手8 小时前
GitHub Copilot:AI编程助手的架构演进与真实世界影响
人工智能·深度学习·大模型·github·copilot·ai编程·codex
xuanerya8 小时前
使用 SSH 方式克隆 GitHub 仓库没有权限解决办法
运维·ssh·github
希尔伯特旅馆13 小时前
Tushare:量化投资数据获取
github
码农小白-RMS13 小时前
cursor-执行git指令(vscode同理)
git