我刚刚尝试从github推送到heroku,这发生了,有人知道如何解决这个问题吗?
$ git push heroku master
ERROR: Repository not found.
fatal: The remote end hung up unexpectedly
我刚刚尝试从github推送到heroku,这发生了,有人知道如何解决这个问题吗?
$ git push heroku master
ERROR: Repository not found.
fatal: The remote end hung up unexpectedly
在您的项目文件夹中进入 .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 上的主分支, heroku
是 heroku 上存储库的名称和路径。
重要的是(a)您有一个 heroku
条目,因为这就是使您的推送工作的原因,并且(b)它指向正确的路径/存储库。
要获取项目的路径/存储库,请进入 heroku 上的应用程序设置,它应该被列出。
附带说明一下, .git/config
文件中的这些远程列表是使您在命令行上使用的别名完全起作用的原因,并且它们的名称可以在配置文件中找到。
为了简单的解决方案,删除现有的 heroku git repo 并重新创建它。
git remote rm heroku
然后重新创建它
heroku create
以后如果你想重命名
heroku rename <name of your app>
在配置文件的[远程“ Heroku”]部分中,用我们的应用程序名称替换了Heroku生成的应用名称
[remote "heroku"]
url = https://git.heroku.com/[your_app_name].git
fetch = +refs/heads/*:refs/remotes/heroku/*
当我遇到这个问题时,我只是从 .git/config 文件中删除了这行代码,然后我尝试重新推送到 heroku(git push heroku master)。