我的仓库使用了Recurly-js的定制版本,并且已使用https://devcenter.heroku.com/articles/git-submodules这些指令将其打包为子模块。但是,现在尝试部署时出现以下错误:

----> Heroku receiving push
-----> Git submodules detected, installing
       Submodule 'recurly-js' (/app/tmp/repo.git/recurly-js) registered for path 'recurly-js'
       Initialized empty Git repository in /tmp/build_3iacvn8h2rnha/recurly-js/.git/
       fatal: '/app/tmp/repo.git/recurly-js' does not appear to be a git repository
       fatal: The remote end hung up unexpectedly
       Clone of '/app/tmp/repo.git/recurly-js' into submodule path 'recurly-js' failed
 !     Heroku push rejected, Submodule install failed

最佳答案

我将答案作为对@ jeffrey-k答案的评论,但现在我更加确定了,我将在此处写下。

我的仓库突然停止推送了,这两件事“解决了”它:

  • 将所有公共(public)子模块URL(如果有)从使用ssh传输URL更改为只读git传输URL(即,从git@github.com:yaniv-aknin/public-projectgit://github.com/yaniv-aknin/public-project)。为此,您将需要在存储库根目录中编辑名为.gitmodules的文件。
  • 从我的存储库中删除所有私有(private)子模块(如果有的话)(从.gitmodulesrm -fr的目录中删除它们)。
  • 提交更改。

  • 这可以处理以下两种行为更改:
  • Heroku过去能够使用ssh传输从github克隆子模块(大概他们有一些“通用的heroku ssh key ”和github帐户,但不确定)。
  • Heroku过去会忽略失败的子模块,而只是继续进行推送。

  • 我开了一张票,询问我的分析是否正确以及为什么会发生更改(我没有听到任何警告)-如果我学到新知识,我将更新此答案。

    更新:来自Heroku的支持的Noah回答了我的问题,并在很大程度上认可了我上面所说的。根据this文档,应更改公共(public)存储库URL,应删除私有(private)存储库或在其中嵌入凭据;后一种解决方案具有明显的安全后果。

    09-04 11:25
    查看更多