我无法使用默认端口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然而,类似的条目对heroku不起作用:
Host heroku.com
User git
Hostname ssh.heroku.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa
Port 443它似乎挂在这个调试行:
debug1: identity file /c/Users/[my folder name]/.ssh/id_rsa type 1...before失败,并显示以下消息:
ssh_exchange_identification: Connection closed by remote host.我对这个答案抱有希望,Error in git push heroku master through ssh behind proxy它对我也不起作用……
任何建议都将受到欢迎。
发布于 2013-04-04 09:44:53
Heroku正致力于提供将源代码转移到平台上的替代方法,例如,看看heroku push:https://github.com/ddollar/heroku-push
它使用https,因此不会受到您所遇到的防火墙拦截的影响。
更新
Heroku现在支持beta HTTP Git。如果问题是由于您无法在端口22上访问Heroku造成的,那么HTTP Git应该可以解决它(它在端口443上工作)。
要使用HTTP Git,首先要确保工具带已更新,并且您的凭据是最新的:
$ heroku update
$ heroku login(这一点很重要,因为Heroku HTTP Git的身份验证方式与工具带的其余部分略有不同)
在测试版中,您可以通过将--http-git标志传递给相关的heroku apps:create、heroku git:clone和heroku git:remote命令来获取HTTP。要创建新的应用程序并使用HTTP Git遥控器对其进行配置,请运行以下命令:
$ heroku apps:create --http-git要将现有应用程序从SSH更改为HTTP Git,只需从计算机上的应用程序目录运行以下命令:
$ heroku git:remote --http-git
Git remote heroku updated查看Dev Center documentation for details on how set up HTTP Git for Heroku。
发布于 2013-04-04 09:12:09
哇。让我印象深刻的是,github有远见在443上运行ssh。很可能heroku正在运行https,这显然不允许您通过git建立ssh连接。
既然github为你工作,为什么不利用它呢?使用travisci这样的服务来监视github、构建和部署到heroku。
使用travis的一个简单示例:http://metabates.com/2012/10/23/deploying-to-heroku-from-travisci/
https://stackoverflow.com/questions/15800806
复制相似问题