【问题标题】:git push heroku master error: Repository not foundgit push heroku master 错误:找不到存储库
【发布时间】:2013-08-30 10:54:27
【问题描述】:

我刚刚尝试从 github 推送到 heroku,但发生了这种情况,有人知道如何解决这个问题吗?

$ git push heroku master
ERROR: Repository not found.
fatal: The remote end hung up unexpectedly

【问题讨论】:

    标签: heroku git-push


    【解决方案1】:

    在您的项目文件夹中,进入.git/config 并查看heroku 远程下定义的内容(如果有的话)。

    例如,我的一个应用有:

    [remote "origin"]
      url = git@github.com:jefflunt/cortex.git
      fetch = +refs/heads/*:refs/remotes/origin/*
    [branch "master"]
      remote = origin
      merge = refs/heads/master
    [remote "heroku"]
      url = git@heroku.com:cortex-cedar.git
      fetch = +refs/heads/*:refs/remotes/heroku-cedar/*
    

    ...origin 是 github 存储库,master 是 github 上的 master 分支,heroku 是 heroku 上存储库的名称和路径。

    重要的是 (a) 你有一个 heroku 的条目,因为这是你推送工作的原因,并且 (b) 它指向正确的路径/repo。

    要获取项目的路径/存储库,请进入 heroku 上的应用程序设置,它应该被列出。

    附带说明,.git/config 文件中的这些远程列表是使您在命令行上使用的别名完全起作用的原因,并且它们的名称可以在配置文件中找到。

    【讨论】:

    • running git remote 将 heroku 列为远程(连同原点),它指向正确的 git url(我在 heroku 应用程序设置页面上找到)-但这仍然导致 Repository not found
    • 你能把你的.git/config文件的内容贴出来吗?列出此 heroku 存储库的页面的屏幕截图也会有所帮助。您可以毫无问题地推送到origin 吗?如果我们不能从中找到任何东西,那么可能是时候向 heroku 开一张支持票了。
    【解决方案2】:

    当我遇到这个问题时,我只是从 .git/config 文件中删除了这行代码,然后我尝试重新推送到 heroku(git push heroku master)。

    [remote "heroku"]
        url = https://git.heroku.com/dry-bastion-47289.git
        fetch = +refs/heads/*:refs/remotes/heroku/*
    

    【讨论】:

      【解决方案3】:

      为了简单的解决方案,删除现有的 heroku git repo 并重新创建它。

      git remote rm heroku
      

      然后重新创建它

      heroku create
      

      如果你想重命名,以后可以

      heroku rename <name of your app>
      

      【讨论】:

      • 这是我想要的解决方案。谢谢
      猜你喜欢
      • 2013-02-03
      • 2016-12-26
      • 1970-01-01
      • 2021-09-23
      • 1970-01-01
      • 2016-02-19
      • 2014-07-05
      • 1970-01-01
      • 2019-10-14
      相关资源
      最近更新 更多