如何将Git子目录推送到heroku?

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

  ! 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' 

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

检查git-subtree插件。 您可以使用它将子项从项目拆分为子项目并返回。

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

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