git - Heroku 使用子模块自动推送到 github

标签 git heroku github

Heroku 提供了一个漂亮的 deploy to from github to heroku automatically :

Automatic deploy

但它也说:

GitHub repos that use submodules will generally not deploy correctly on Heroku. This is because GitHub does not include submodule contents when repo-content tarballs are generated.

这是否意味着如果我有子模块就没有解决方法?

目前该功能变得无用

我发现他们的信息非常简短和尖锐,尤其是当他们 actually recommend to use submodules .

他们不能触发 git push heroku master 吗?和/或至少保留以前的子模块内容(以便在子模块未更改时工作,这是 99% 的情况)。或者我应该向 heroku 提供对子模块内容的访问权限吗?

我们将不胜感激任何反馈。

最佳答案

事实上,GIT 推送并不是使用 GitHub Sync 时执行的。相反,platform api被使用了。
该 API 端点采用压缩包 URL 并将其部署在应用程序上。

GitHub 提供的 tarball 不包含 GIT 存储库的内容。只有应用程序。因此,不可能检索该内容并将存储库包含在其中。

我已经设置了一个构建包,它会为你做这个: https://github.com/dmathieu/heroku-buildpack-submodules

它将解析您的 .gitmodules 内容并在构建期间安装所有子模块,而不关心是否存在 .git 文件夹。

关于git - Heroku 使用子模块自动推送到 github,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38248407/

相关文章:

每个作者的 GIT 贡献(行)

javascript - Node.js 和 postgres 听

python - 在 Heroku 上运行 Django 自定义 manage.py 任务 - 导入问题

javascript - Rails 5 + Webpacker 应用程序作为空白页面部署到 Heroku,没有失败

Github API 指定上一个标签

android - Github 桌面不显示来自 Android Studio 的更改

GitHub 操作 "set-env"结果为 "No such file or directory"

git - github 上的 pull 请求 - 显示从 master 重新提交的提交

git - 我怎样才能 git stash 一个特定的文件?

git - 检查 git 中的提交系列中是否修改了其他文件