【问题标题】:How to access heroku git over https behind firewalls restricting ssh如何在限制 ssh 的防火墙后面通过 https 访问 heroku git
【发布时间】:2015-02-23 22:52:30
【问题描述】:

Heroku 部署在我家就像一个魅力。

但是我的办公室网络限制了 ssh,这会阻止命令“git push heroku master” 有没有办法使用 heroku git 存储库的 https url 来推送我的应用程序。

【问题讨论】:

  • 经过进一步挖掘,似乎 heroku 不支持 git over https。唯一的解决方法是在 GitHub 或任何其他支持 https 的存储库中维护项目的副本。使用此 repo 在不支持 ssh 的位置工作。要部署到 heroku,请克隆此应用程序并从无防火墙的机器进行部署。
  • 您也可以使用 Tor 作为 Git 的 SOCKS 代理。

标签: git https ssh heroku


【解决方案1】:

您只能通过 ssh 推送到 heroku git。

更新(根据@ryanbrainard 评论): HTTP Git 现在是 GA https://blog.heroku.com/archives/2014/12/5/http_git_now_generally_available

【讨论】:

  • 那仍然是最新的吗?
  • omg... 我花了一个小时才弄清楚这一点。到目前为止,使用全局 insteadOf 指令还没有问题。我猜 github、bitbucket 和我使用的所有其他工具都支持 https。为什么不是 Heroku?
  • 另一个问题:Heroku 为什么不能直接从 Github 拉取?
  • Heroku 现在支持 HTTP Git:devcenter.heroku.com/articles/http-git
  • HTTP Git 现在是GA
【解决方案2】:

heroku toolbelt 的这个插件可以让你推过 https:

https://github.com/ddollar/heroku-push

【讨论】:

  • heroku run 有没有类似的东西?
  • 那使用 Heroku API 推送,我假设它仍然使用 SSH?
  • 对我有用。我无法通过 git(公司防火墙问题)并且使用此插件可以正常工作。太好了!
  • 这个方法是deprecated。请使用HTTP Git
【解决方案3】:

Heroku 现在支持基于 HTTP 的 GIT(这是一个测试版功能)。检查https://devcenter.heroku.com/articles/http-githttps://git.heroku.com/{app-name}.git 将是您的仓库的 URL。

【讨论】:

    【解决方案4】:

    Heroku 现在拥有完整的 HTTP Git support,并且是新应用的默认选项。如果要将现有应用从 SSH Git 更改为 HTTP Git,请运行:

    $ heroku git:remote
    

    然后像往常一样推送:

    $ git push heroku master
    

    详情请见documentation

    【讨论】:

      猜你喜欢
      • 2010-12-16
      • 1970-01-01
      • 2011-06-06
      • 2011-02-01
      • 2011-07-02
      • 2012-02-06
      • 1970-01-01
      相关资源
      最近更新 更多