【问题标题】:Error Pushing my Repository to Github将我的存储库推送到 Github 时出错
【发布时间】:2012-06-06 18:22:05
【问题描述】:

我在终端输入了:

Parkers-MacBook-Pro:first_app ppreyer$ git push -u origin master
Username: 
Password:

我得到这个错误:

error: The requested URL returned error: 403 while accessing https://github.com/ppreyer/first_app.git/info/refs

fatal: HTTP request failed

我猜这与我的用户名和密码有关,但我觉得我输入了正确的信息。有没有办法知道我的用户名和密码是什么?

【问题讨论】:

标签: git github terminal


【解决方案1】:

您的远程网址似乎错误。

尝试运行以下命令:

git remote rm origin
git remote add origin git@github.com:ppreyer/first_app.git
git push origin master

【讨论】:

  • 在我输入 git push origin master 后,我得到这个错误:错误:src refspec master does not match any。错误:未能将一些参考推送到 'git@github.com:ppreyer/first_app.git' 有什么想法吗?
【解决方案2】:

您可能已经克隆了公共只读 url。 如果您可以设置 ssh 密钥并将其添加到您的 github 帐户中,那就更好了。

关注这个guide

要解决您可能面临的问题,您可以按照 Gazier 发布的答案进行操作。我正在添加另一种方法。

  1. 编辑你的repo目录下的.git/config文件
  2. [remote "origin"] 部分下找到url=entry
  3. 确保它是git@github.com:ppreyer/first_app.git

现在尝试将原点推送到主控

【讨论】:

    【解决方案3】:

    将你的 GitHub 用户名添加到你的“remote.origin.url”,就在你的 url 中的 github.com 之前:

    https://ppreyer@github.com/ppreyer/first_app.git

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-08-02
      • 2021-12-22
      • 2012-08-25
      • 2020-01-21
      • 2012-06-10
      • 1970-01-01
      • 1970-01-01
      • 2019-06-18
      相关资源
      最近更新 更多