参考资料:https://stackoverflow.com/questions/7438313/pushing-to-git-returning-error-code-403-fatal-http-request-failed

我刚刚遇到了同样的问题,想出了是什么原因:

Github 似乎只支持 ssh 方式来读写 repo,尽管 https 方式也显示了“读写”。

因此,您需要将 PC 上的 repo 配置更改为 ssh 方式:

  • 编辑.git/configrepo 目录下的文件

  • url=在部分下找到条目[remote “origin”]

  • 将其从 url=https://MichaelDrogalis@github.com/derekerdmann/lunch_call.git 更改 为url=git@github.com/derekerdmann/lunch_call.git。也就是说,将@符号之前的所有文本更改为ssh://git 保存config文件并退出。
    在这里插入图片描述
    在这里插入图片描述

  • 现在你可以用来git push origin master在 GitHub 上同步你的 repo

Logo

瓜分20万奖金 获得内推名额 丰厚实物奖励 易参与易上手

更多推荐