如何推Git子目录到heroku? [英] How push Git sub-directory to heroku?

查看:137
本文介绍了如何推Git子目录到heroku?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在github上,我在一个目录的子目录中有一个Rails应用程序, github.com/sadaf2605/directory/subdirectory/ {rails app} 。当我尝试将此应用推送到Heroku时,出现错误:

 ! Heroku推拒绝,没有雪松支持的应用程序检测到

到git@heroku.com:潮湿林地-7566.git
! [remote rejected] master - > master(pre-receive hook refused)
错误:未能推送一些文件到'git@heroku.com:damp-woodland-7566.git'

阅读 Heroku推送被拒绝,没有雪松支持的应用程序检测到wordpress ,我知道这个子目录导致了这个问题。但是,我希望这个子目录保留在github上,因为它可以帮助我组织工作,但我不想更改route.rb。是否有可能?

解决方案

检出 git-subtree 插件。您可以使用它将项目中的子树分割成子项目并返回。



$ git subtree push --prefix {rails app} heroku master



克隆github项目并运行 sudo sh install.sh 安装插件。完整使用说明位于此处


On github I have a Rails app in a sub-directory of a directory, github.com/sadaf2605/directory/subdirectory/{rails app}. When I try to push this app to Heroku I get an error:

 !     Heroku push rejected, no Cedar-supported app detected

To git@heroku.com:damp-woodland-7566.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@heroku.com:damp-woodland-7566.git'

After reading "Heroku push rejected, no Cedar-supported app detected wordpress", I learned that this sub-directory is causing the problem. But, I want this sub directory to remain at github as it helps me to organize my work yet I don't want to change the route.rb. Is it possible?

解决方案

Checkout the git-subtree plugin. You can use it to split subtrees from your project into subprojects and back.

git subtree push --prefix {rails app} heroku master

Clone the github project and run sudo sh install.sh to install the plugin. Full usage instructions are in the here

这篇关于如何推Git子目录到heroku?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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