如何将我的 git repo 的一部分推送到 Heroku? [英] How can I push a part of my git repo to Heroku?

查看:23
本文介绍了如何将我的 git repo 的一部分推送到 Heroku?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个已经在 Github 上的多模块应用程序.它由两个模块组成,一个是 Android 应用程序,另一个是基于 Rails 的 Web 应用程序.所以我项目的目录结构是这样的:

I have a multi-module app that is already on Github. It is comprised of two modules, one of them an Android app and the other a Rails based Web app. So my project's directory structure is in the form of:

ProjectRoot
|
+-- web
|
+-- android
|
+-- .git

因此,我不能简单地 cd 进入 ProjectRoot 并将我的应用程序推送到 Heroku,因为 Rails 应用程序的根文件夹是 ProjectRoot/web.有没有办法将 web 文件夹推送到 Heroku?如果我将 Web 转换为 git 子模块,应该很容易实现这一点,但是我在 Git 上只有 5 个私有存储库,而且我更愿意为我的整个应用程序只使用 1 个存储库.

As such I cannot simply cd into ProjectRoot and push my app to Heroku as the root folder of the Rails app is ProjectRoot/web. Is there a way to push the web folder to Heroku? If I turn web into a git sub module, it should be easy to accomplish this, but then I only have 5 private repos on Git and I prefer to consume only 1 repo for my whole app.

推荐答案

您可以使用 git subtree push.它将生成一个以您的目录为根目录的新提交树,并推送它.

You can use git subtree push. It will generate a new commit tree with your directory as root, and push it.

git subtree push --prefix web heroku master

完整文档在这里.

这篇关于如何将我的 git repo 的一部分推送到 Heroku?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆