我如何只部署/推送我的git repo的子目录给Heroku? [英] How can I deploy/push only a subdirectory of my git repo to Heroku?
问题描述
我有一个项目使用服务,并使用Git进行版本控制。 Serve用静态文件创建一个输出
文件夹,我想部署到Heroku。
I have a project that uses Serve and is version controlled using Git. Serve creates an output
folder with static files that I want to deploy to Heroku.
我不想部署Serve项目本身,因为Heroku Cedar堆栈似乎不太喜欢它,但最重要的是我想利用Heroku对静态网站的巨大支持。
I don't want to deploy the Serve project itself since the Heroku Cedar stack doesn't seem too fond of it, but most importantly I want to take advantage of Heroku's great support for static websites.
有没有办法将子文件夹部署到git远程?
我应该在输出
文件夹中创建一个Git仓库(听起来不对),然后将其推送到Heroku?
Is there a way to deploy a subfolder to a git remote?
Should I create a Git repo in the output
folder (that sounds wrong) and push that to Heroku?
推荐答案
通过 git的子树。假设你想把你的文件夹的'output'作为root推送到Heroku,你可以这样做:
There's an even easier way via git-subtree. Assuming you want to push your folder 'output' as the root to Heroku, you can do:
git subtree push --prefix output heroku master
目前git-subtree被包含在git-core中,但我不知道不知道该版本的git-core是否已经发布。
It appears currently that git-subtree is being included into git-core, but I don't know if that version of git-core has been released yet.
这篇关于我如何只部署/推送我的git repo的子目录给Heroku?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!