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

问题描述

今天我在使用git push 将修改的项目push到github中,出现:

remote: Permission to xxxxx.git denied to xxx.
fatal: unable to access 'https://github.com/ xxxxx.git/': > The requested URL returned error: 403

解决方案

第一步,将github中的项目clone下来

第二步,修改.git/cofig中的url

cd 到项目中,编辑 .git/cofig中的url
vim .git/config

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

第三步,git push -u origin master

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • Lesson 3: Using GitHub to Collaborate 3.1 Creating a GitH...
    赤乐君阅读 11,324评论 3 11
  • 配置 首先是配置帐号信息 ssh -T git@github.com#登陆github 修改项目中的个人信息 1 ...
    rochuan阅读 4,151评论 1 1
  • git常用命令 GIT常用命令备忘:http://stormzhang.com/git/2014/01/27/gi...
    新篇章阅读 12,765评论 1 26
  • Spring Cloud为开发人员提供了快速构建分布式系统中一些常见模式的工具(例如配置管理,服务发现,断路器,智...
    卡卡罗2017阅读 135,771评论 19 139
  • 冬日小假,阳光明媚,背起背包,一个人来了一次说走就走的徒步游。 沿着熟悉的小路,走了很久,走到不再熟悉的地方。天空...
    梅园遗珠阅读 2,593评论 2 3