git 无法提交报错 - error: The requested URL returned error: 403 Forbidden while accessing https://github.c

古城微笑少年丶 2022-08-22 00:03 61阅读 0赞

git clone 下来的时候,执行

  1. git push origin master

的时候报错:

  1. error: The requested URL returned error: 403 Forbidden while accessing https://github.com

修复方式

  1. vi .git/config
  2. [remote "origin"]
  3. fetch = +refs/heads/*:refs/remotes/origin/*
  4. url = https://github.com/fancyecommerce/yii2-fec.git

改成

  1. [remote "origin"]
  2. fetch = +refs/heads/*:refs/remotes/origin/*
  3. url = https://fancyecommerce@github.com/fancyecommerce/yii2-fec.git

继续执行

  1. git push origin master

报错:

Gtk-WARNING **: cannot open display:

执行:

  1. unset SSH_ASKPASS

继续执行git push origin master

  1. [root@services fec]# git push origin master
  2. Password:
  3. Counting objects: 503, done.
  4. Delta compression using up to 4 threads.
  5. Compressing objects: 100% (485/485), done.
  6. Writing objects: 100% (498/498), 1.67 MiB | 255 KiB/s, done.
  7. Total 498 (delta 130), reused 2 (delta 0)
  8. To https://fancyecommerce@github.com/fancyecommerce/yii2-fec.git
  9. 936020b..07260aa master -> master

成功

发表评论

表情:
评论列表 (有 0 条评论,61人围观)

还没有评论,来说两句吧...

相关阅读