ruby-on-rails - Heroku:如果你在 heroku 中有多个应用程序,你如何推送到特定的应用程序?

标签 ruby-on-rails ruby ruby-on-rails-4 heroku ruby-on-rails-5

我使用 heroku create test-app3 创建了一个新的 heroku 应用程序。现在,如果我想将一些代码推送到这个新的 test-app3,我该怎么做?

当我在终端输入 heroku list 时,我得到: 我的应用

  • test-app1
  • test-app2
  • test-app3

如何推送到 test-app3?如何在推送到哪个应用之间切换?

最佳答案

您需要为 Heroku 中的每个应用程序设置不同的 git 远程端点,以便您可以从一个本地存储库推送到任一应用程序。

通过仪表板获取您在 Heroku 上的应用的 GIT URL(它看起来类似于:https://git@heroku.com:your_app_name.git)并执行:

git remote add test-app1 https://git@heroku.com:test-app1.git

git remote add test-app2 https://git@heroku.com:test-app2.git

git remote add test-app3 https://git@heroku.com:test-app3.git

然后你就可以像这样推送到任何特定的应用程序:

git push test-app1 master

git push test-app2 master

git push test-app3 master

关于ruby-on-rails - Heroku:如果你在 heroku 中有多个应用程序,你如何推送到特定的应用程序?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32815483/

相关文章:

ruby-on-rails - 一次更新原始属性后尝试保存时出现 ActiveResource::BadRequest 错误

ruby-on-rails - Rails 4 ActionController::InvalidAuthenticityToken 与多个子域

javascript - 同时使用 dom 和 sDom 选项

ruby-on-rails - Rails 验证除非

ruby-on-rails - 什么测试工具/框架可以测试 Rails 应用程序中的并发请求?

ruby-on-rails - 在开发模式下设置 ssl on rails 4 app

Ruby 和指南针路径与 yeoman 项目

ruby-on-rails - 是否有用于页面统计的 Rails Gem?

ruby-on-rails - 如何在 Rails 的 VIews 模板中创建和使用变量?

ruby-on-rails - 如何正确设置我的CanCanCan权限?