【问题标题】:How push Git sub-directory to heroku?如何将 Git 子目录推送到 heroku?
【发布时间】:2012-12-20 13:31:04
【问题描述】:

在 github 上,我在 github.com/sadaf2605/directory/subdirectory/{rails app} 目录的子目录中有一个 Rails 应用程序。当我尝试将此应用推送到 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 rejected, no Cedar-supported app detected wordpress”后,我了解到是这个子目录导致了问题。但是,我希望这个子目录保留在 github 上,因为它可以帮助我组织我的工作,但我不想更改 route.rb。有可能吗?

【问题讨论】:

  • 可能最好的做法是让 rails 应用程序成为自己的 git 存储库,然后使其成为第一个存储库的子模块。

标签: ruby-on-rails ruby git heroku github


【解决方案1】:

查看git-subtree 插件。您可以使用它来将项目中的子树拆分为子项目并返回。

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

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

【讨论】:

  • Subtree 已被合并到 git 中,因此您现在无需安装插件即可运行上述命令。
猜你喜欢
  • 2011-11-24
  • 2021-10-24
  • 1970-01-01
  • 2011-10-22
  • 1970-01-01
  • 2020-05-26
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多