解决git push 中remote: Permission to xxxxx.git denied to xxx. fatal: unable to access 'https://github.com/ xxxxx.git/':URL .......

使用git push -u origin master 命令时 出现 :

remote: Permission to gavincook/test.git denied to kase-ding.
fatal: unable to access 'https://github.com/gavincook/test.git/': The requested URL returned error: 403

出现这个提示是因为没有访问权限,要么登录了两个账户,要么就是config中的url 地址错误

解决方法:

  1. 找到你要上传的项目文件夹,文件夹中会有.git文件,如果已经git init 没有看到 .git 文件,

点 查看 勾选 隐藏的项目:

打开.git文件中的config文件,编辑 .git/config中的url:

将config中的url中的

[remote "origin"]
url = https://github.com/git的用户名/项目名称
的url改为
url = https://git的用户名@github.com/git的用户名/项目名称

参考:https://www.cnblogs.com/angel648/p/13366030.html?utm_source=tuicool

posted @   micer  阅读(2140)  评论(0编辑  收藏  举报
编辑推荐:
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
阅读排行:
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· SQL Server 2025 AI相关能力初探
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
点击右上角即可分享
微信分享提示