2013-01-06 30 views
4

在github上,我在一个目录的子目录中有一个Rails应用程序,github.com/sadaf2605/directory/subdirectory/{rails app}。当我试图把这个程序的Heroku我得到一个错误:如何将Git子目录推送到heroku?

!  Heroku push rejected, no Cedar-supported app detected 

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

阅读“Heroku push rejected, no Cedar-supported app detected wordpress”之后,我才知道,这个子目录是造成问题的原因。但是,我希望这个子目录保留在github上,因为它可以帮助我组织工作,但我不想更改route.rb。可能吗?

+2

可能最好的行动是让rails应用它自己的git仓库,然后将其作为第一个仓库的子模块。 – quandrum

回答

4

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

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

克隆GitHub的项目并运行sudo sh install.sh安装插件。完整的使用说明在here

+1

Subtree已经被合并到'git'中,所以你现在可以运行上面的命令而不需要安装插件。 –