推送到Heroku失败 - 没有这个应用程序致命错误

17

在 Heroku 上进行 Git 推送指向一个不存在的 Git 存储库。

git.heroku.com/secure-reef-1722.git 这是我们运行 heroku create 命令时创建的存储库。

但当我们运行 'push' 命令 ($ git push heroku master) 时,它会显示:

remote: ! No such app as boiling-inlet-6957. fatal: repository 'https://git.heroku.com/boiling-inlet-6957.git/' not found

此外,当我们运行 $ git remote -v 时,也无法看到新的存储库。

heroku  https://git.heroku.com/boiling-inlet-6957.git (fetch)
heroku  https://git.heroku.com/boiling-inlet-6957.git (push)
origin  git@bitbucket.org:coderz$/toy_app.git (fetch)
origin  git@bitbucket.org:coderz$/toy_app.git (push)

现在我们无法将文件推送到新的heroku git存储库(git.heroku.com/secure-reef-1722.git)

请帮助我们。先行致谢。

完整的命令序列

coderz$:~/workspace/toy_app (master) $ heroku create
Creating secure-reef-1722... done, stack is cedar-14
https://secure-reef-1722.herokuapp.com/ | https://git.heroku.com/secure-reef-1722.git
coderz$:~/workspace/toy_app (master) $ git push heroku master
remote: !       No such app as boiling-inlet-6957.
fatal: repository 'https://git.heroku.com/boiling-inlet-6957.git/' not found
coderz$:~/workspace/toy_app (master) $ git remote -v
heroku  https://git.heroku.com/boiling-inlet-6957.git (fetch)
heroku  https://git.heroku.com/boiling-inlet-6957.git (push)
origin  git@bitbucket.org:coderz$/toy_app.git (fetch)
origin  git@bitbucket.org:coderz$/toy_app.git (push)
coderz$:~/workspace/toy_app (master) $ 

1
这个问题的解决方案是由'Collin Graves'在这个问题中给出的答案。 - Vikram
7个回答

69
尝试重新添加远程URL。
// Check for the current url 
git remote -v

// remove remote url
git remote rm heroku

// re-add the remote url
git remote add heroku git@heroku.com:boiling-inlet-6957.git

这里输入图片描述


1
"boiling-inlet-6957.git" 我们已经在Heroku上删除了与此存储库相关联的应用程序。所以再次添加此存储库没有意义。我们只希望新的存储库得到接受,旧的已删除的应用程序应该被清除。 - Vikram
1
很好,Swift小伙子,那么只需将包含boiling-inlet的最后一部分替换为git.heroku.com/secure-reef-1722.git。你只是缺少正确的远程入口。 - benjamin
设置正确的名称,我不知道您需要的名称是哪个。 - CodeWizard
3
2020年4月,工作依然非常顺利。 - Ashwani Garg
1
谢谢,这对我很有用,来自哥伦比亚的敬礼。 - AllisLove

17

这个命令解决了我的问题

git remote rm heroku
git remote add heroku https://git.heroku.com/app-name.git

2

我按照以下步骤进行操作:

  1. git remote rm heroku # 移除远程URL

  2. git remote add heroku https://git.heroku.com/myapp.git

添加新的Heroku远程URL

  1. git remote -v

验证正确的远程URL

  1. git push heroku master

推送更改


1

我通过运行以下命令解决了同样的问题:

在运行以下命令之前先运行: heroku login

然后再运行: git remote add heroku https://git.heroku.com/app-name.git


0
以下解决方案适用于我:
  1. 检查当前URL:git remote -v
  2. 删除当前URL:git remote rm heroku
  3. 设置新的URL:git remote add heroku git.heroku.com/<<YOUR_URL>>.git

0
  1. 第一步是在Heroku上删除现有的链接

    git remote rm heroku

  2. 添加新的Heroku链接。(请注意按照下面链接的确切格式进行操作)

    git remote add heroku https://git.heroku.com/app-name.git

  3. 在本地测试您当前在Heroku上的代码

    heroku local web

  4. 将所有更改推送到Heroku

    git push heroku main

之后您应该就没问题了。如果您还有问题,请在下面的评论中告诉我。


-1
git remote -v
heroku  https://git.heroku.com/falling-wind-1624.git (fetch)
heroku  https://git.heroku.com/falling-wind-1624.git (push)


 heroku git:remote -a falling-wind-1624

1
你能用言语解释一下,这个问题的提问者做错了什么,为什么上面的内容可以解决这个问题吗? - G. Sliepen

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接