【问题标题】:fatal: repository 'https://github.com/user_name/first_app.git/' not found致命:找不到存储库“https://github.com/user_name/first_app.git/”
【发布时间】:2013-12-11 01:52:54
【问题描述】:

我试图将我的文件推送到github,但我收到了这个错误。不幸的是,他们所谓的用户名都不起作用!有什么想法吗?

Monas-MacBook-Pro:first_app mona$ git push -u origin master
Username for 'https://github.com': lamiastella
Password for 'https://lamiastella@github.com': 
remote: Repository not found.
fatal: repository 'https://github.com/lamiastella/first_app.git/' not found
Monas-MacBook-Pro:first_app mona$ git push -u origin master
Username for 'https://github.com': jalal@wisc.edu
Password for 'https://jalal@wisc.edu@github.com': 
remote: Repository not found.
fatal: repository 'https://github.com/lamiastella/first_app.git/' not found

这是我在此命令之前使用的命令列表:

521  git init
522  git add .
523  git status
524  git commit -m "hi"
525  git status
526  git log
527  git checkout -f
528  git status
531  git remote add origin https://github.com/lamiastella/first_app.git

【问题讨论】:

  • @zerkms 在这里搜索“git push”ruby.railstutorial.org/… 我一直在关注这本手册,但我不确定我错过了什么
  • 您错过了将 NOT EXISTING 存储库添加为 origin 的事实。再次阅读文章中git push之前的一段:“注册后,点击链接创建仓库并按照图1.6填写信息。”
  • @zerkms 啊,非常感谢。我忘了在 github 站点中创建一个存储库。但是,是否有任何用于创建名为 first_app 的存储库的终端命令?
  • 有一个用于创建存储库的 GitHub API 端点:developer.github.com/v3/repos/#create 所以大概有一些工具可以使用它,但我从来没有想到过(创建存储库是一个罕见的过程,仍然需要你使用 github.com 来正确设置)
  • 也有可能您还没有对该仓库的“推送”权限...

标签: git version-control github repository


【解决方案1】:

我刚刚遇到了同样的问题。就我而言,问题不在于我,这是因为 Github 的 SSH 访问存在问题,正如他们在状态页面上所说的 (https://status.github.com/)

“我们正在调查存储库访问和一些 GitHub.com 功能的问题。一旦我们有更多信息要分享,我们会报告回来。”

【讨论】:

    【解决方案2】:

    如果您需要编写所有过程的脚本,包括创建新的仓库,您可以查看“Github v3 API - create a REPO”或this gist

    # Test drive on a single liner
    # TOKEN="xxxx" org="plone-gomobile" p=test ; curl -v -XPOST -H "Authorization: token $TOKEN" https://api.github.com/orgs/$org/repos -d '{"name": "'"$p"'"}'
    curl -v -XPOST -H "Authorization: token $TOKEN" https://api.github.com/orgs/$org/repos -d '{"name": "'"$p"'"}'
    

    在“Authentication”阅读更多内容,注意OAuth2 tokens 可以是acquired programmatically,这对您的脚本很有帮助。

    【讨论】:

    • 谢谢。这很有帮助。