通过端口443推送到heroku

gro*_*ble 8 git ssh heroku

我无法使用默认端口22,因此根据hartl rails教程设置git和heroku遇到了困难.

我可以通过在〜/ .ssh/config文件中包含以下内容来推送到git:

Host github.com
User git
Hostname ssh.github.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa
Port 443
Run Code Online (Sandbox Code Playgroud)

但是,类似的条目对heroku不起作用:

Host heroku.com
User git
Hostname ssh.heroku.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa
Port 443
Run Code Online (Sandbox Code Playgroud)

它似乎挂在这个调试行:

  debug1: identity file /c/Users/[my folder name]/.ssh/id_rsa type 1
Run Code Online (Sandbox Code Playgroud)

...在收到此消息失败之前:

  ssh_exchange_identification: Connection closed by remote host.
Run Code Online (Sandbox Code Playgroud)

我有希望得到这个答案, git push heroku master中的错误通过代理后面的ssh 它对我来说也不起作用......

任何的建议都受欢迎.

fri*_*ism 11

Heroku正致力于提供将源代码移动到平台上的替代方法heroku push,例如:https://github.com/ddollar/heroku-push

它使用https,因此不会受到您遇到的防火墙阻塞的影响.

UPDATE

Heroku现在有beta HTTP Git支持.如果问题是由于您无法在端口22上访问Heroku引起的,那么HTTP Git应该解决它(它在端口443上工作).

要使用HTTP Git,首先要确保更新Toolbelt并确保您的凭据是最新的:

$ heroku update
$ heroku login
Run Code Online (Sandbox Code Playgroud)

(这很重要,因为Heroku HTTP Git的验证方式与Toolbelt的其余部分略有不同)

在测试期间,这可以通过使用HTTP获得--http-git标志相关的heroku apps:create,heroku git:cloneheroku git:remote命令.要创建新应用并使用HTTP Git远程配置,请运行以下命令:

$ heroku apps:create --http-git
Run Code Online (Sandbox Code Playgroud)

要将现有应用程序从SSH更改为HTTP Git,只需从计算机上的应用程序目录运行此命令:

$ heroku git:remote --http-git
Git remote heroku updated
Run Code Online (Sandbox Code Playgroud)

查看开发人员中心文档,了解如何为Heroku设置HTTP Git的详细信息.