加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

ruby-on-rails – Heroku:如果你在heroku中有多个应用程序,你如

发布时间:2020-12-17 01:43:03 所属栏目:百科 来源:网络整理
导读:我使用heroku create test-app3创建了一个新的heroku应用程序.现在,如果我想将一些代码推送到这个新的test-app3,我该怎么做? 当我在终端输入heroku列表时,我得到: 我的应用 test-app1 test-app2 test-app3 我如何推送test-app3?如何在要推送的应用程序之
我使用heroku create test-app3创建了一个新的heroku应用程序.现在,如果我想将一些代码推送到这个新的test-app3,我该怎么做?

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

> test-app1
> test-app2
> test-app3

我如何推送test-app3?如何在要推送的应用程序之间切换?

解决方法

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

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

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

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

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

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

git push test-app1 master

git push test-app2 master

git push test-app3 master

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读