【问题标题】:Heroku app cannot be pushedHeroku 应用无法推送
【发布时间】:2013-09-16 20:24:48
【问题描述】:

我尝试部署我的第一个 heroku 代码,但是当我运行 git push heroku master 时,我收到如下错误:

ssh: connect to host github.com port 22: Connection timed out
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

git remote -v 给,

heroku  git@heroku.com:dry-stream-5959.git (fetch)
heroku  git@heroku.com:dry-stream-5959.git (push)

问题出在哪里?为什么不部署代码?

【问题讨论】:

  • 看起来你并没有推送到 heroku,git 抱怨与github.com 的连接超时。我有点记得过去有这个问题,你介意发布你的git status吗?
  • @ThomasOrozco: git status 命令给出: git status # 在分支主机上没有提交,工作目录干净

标签: django git heroku


【解决方案1】:

我觉得奇怪的是 git push heroku master 引用了“github.com”。
如果您必须推送到 heorku.com,请尝试:

git remote set-url heroku git@heroku.com:dry-stream-5959.git

然后重复您的git push。
如果问题仍然存在,并且 ssh 端口被阻止,则遵循 aforementioned link,但将 github.com 替换为 heroku.com。

【讨论】:

  • 现在我再次收到此错误:ssh_exchange_identification: Connection closed by remote host fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.
  • 对不起,我对这个完全陌生,所以我对此一无所知
  • @AswinMurugesh 正如heroku.com 中提到的,您是否在heroku 方面创建了您的repo? heroku create dry-stream-5959:仔细关注devcenter.heroku.com/articles/git。
  • 我已经用过heroku create,然后才得到这个名字。现在如果我给出这个命令,我会得到name already taken
  • @AswinMurugesh 然后修改远程 url 以匹配服务器上 Heroku 应用程序的名称。
【解决方案2】:

SSH 可能在端口 22 上被阻止。

查看this answer,它可能会对您有所帮助。

【讨论】:

  • 我按照那个答案做了一切。 ssh -T github.com 工作正常。但是这个问题依然存在
【解决方案3】:

制作一个:

ssh -vvv yourlogin@heroku

为了显示在 ssh 通信期间发生的所有操作。

各种原因可能是这些的根源,

  • 来自未正确定义的 $HOME(通常在 环境变量 %HOME% 默认情况下根本没有定义)
  • 到 SSH 守护程序的 IP 冲突地址(请参阅此线程)。

另见答案://Unable to Git-push master to Github

【讨论】:

    猜你喜欢
    • 2018-09-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-15
    • 2016-12-14
    相关资源
    最近更新 更多