【问题标题】:how to deploy to heroku from a custom branch?如何从自定义分支部署到 heroku?
【发布时间】:2021-02-28 12:41:15
【问题描述】:

我在 Heroku 中有 2 个应用程序,一个是生产应用程序,一个是暂存应用程序。我已将生产应用程序远程配置为“heroku”,并将暂存应用程序远程配置为“heroku-staging”,以便我可以按如下方式部署到生产环境

git push heroku master

并在分期如下:

git push heroku-staging master

现在,我想将代码从我的“暂存”分支而不是主分支推送到暂存应用程序。我想完成这个

git push heroku-staging staging  

如果我运行上述命令,Heroku 会跳过部署,说分支既不是“主”也不是“主”,因此跳过构建。

【问题讨论】:

    标签: heroku heroku-cli


    【解决方案1】:

    你可以试试下面的命令:

    git push heroku-staging staging:master
    

    当你想返回时,可以使用以下命令:

    git push -f heroku master:master 
    

    【讨论】:

    • 您能解释一下git push heroku-staging staging:master 的作用吗?它会改变主人吗?
    • 它可以用来从你本地的staging分支推送到你的heroku-staging远程分支的master分支
    • 谢谢。我想这就是我所需要的。
    • 很高兴我能帮上忙 :)
    猜你喜欢
    • 2021-06-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-03-06
    • 2011-10-01
    • 2013-02-27
    • 2014-03-02
    • 2016-11-20
    相关资源
    最近更新 更多