报错原因:

报错提示没有权限访问(由于我的公司电脑上已经登录了公司的git账号,所以推送到我个人的github账号提示没有权限)

 

解决办法:

1、找到仓库下面的 .git 文件,如果没有的话就是被隐藏了

git push 时报错 fatal: unable to access 'https://lisir2@github.com/lisir2/react-study.git/': The requested URL returned error: 403

 

 

2、如果 .git 文件被隐藏,设置显示步骤

git push 时报错 fatal: unable to access 'https://lisir2@github.com/lisir2/react-study.git/': The requested URL returned error: 403

 

 

 

3、编辑 .git/cofig中的url

将
[remote "origin"]
url = https://github.com/git的用户名/项目名称
的url改为
"http://" 后面添加你的github的账号 + ":" + 你的github密码 + git仓库地址 url = http://yourname:password@github.com/xxxxxx/xxxxxxx.git

 git push 时报错 fatal: unable to access 'https://lisir2@github.com/lisir2/react-study.git/': The requested URL returned error: 403

 

 

4、修改之后再去 git push origin master 提交你的代码到远程仓库

 

相关文章:

  • 2021-04-26
  • 2022-12-23
  • 2021-12-14
  • 2022-12-23
  • 2021-12-26
  • 2021-12-09
  • 2022-12-23
  • 2021-10-28
猜你喜欢
  • 2022-12-23
  • 2021-08-04
  • 2021-10-18
  • 2021-06-14
  • 2021-11-03
  • 2021-10-16
  • 2021-11-21
相关资源
相似解决方案