【问题标题】:Heroku Site Upload from Different branchHeroku 网站从不同的分支上传
【发布时间】:2015-11-12 22:10:50
【问题描述】:

我正在处理一个团队项目,我的分支是我想上传到 heroku 的分支。我创建了站点,我的文件 index.php 和 composer.json 是正确的。

我试图从我的分支推送到 heroku:

git push heroku develop-mark

它的回应是:

Counting objects: 98, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (90/90), done.
Writing objects: 100% (98/98), 68.22 KiB | 0 bytes/s, done.
Total 98 (delta 45), reused 0 (delta 0)
remote: Pushed to non-master branch, skipping build.
To https://git.heroku.com/warm-wave-1067.git
* [new branch]      develop-mark -> develop-mark

【问题讨论】:

    标签: git heroku github


    【解决方案1】:

    Heroku only builds from its master branch,但这并不意味着您必须在本地处理 master

    推送到 Heroku 的除 master 之外的分支将被此命令忽略。如果您正在本地处理另一个分支,您可以在推送之前合并到 master,或者指定要将本地分支推送到远程 master。要推送除 master 以外的分支,请使用以下语法:

    $ git push heroku yourbranch:master
    

    在您的情况下,将您的本地 develop-mark 分支推送到 Heroku 的 master,如下所示:

    git push heroku develop-mark:master
    

    【讨论】:

    • $ git push heroku develop-mark:master To https://git.heroku.com/warm-wave-1067.git ! [rejected] develop-mark -> master (non-fast-forward) error: failed to push some refs to 'https://git.heroku.com/warm-wave-1067.git' hint: Updates were rejected because a pushed branch tip is behind its remote hint: counterpart. Check out this branch and integrate the remote changes hint: (e.g. 'git pull ...') before pushing again. hint: See the 'Note about fast-forwards' in 'git push --help' for details.
    • @MarkA,好吧,所以你本地的develop-mark 分支在 Heroku 当前运行的任何东西后面。要么将该分支合并到develop-mark 中,要么将develop-mark 重新定位到该分支上,然后再次推送。或者,如果您确定要这样做,请强制推送到 Heroku。我经常强制推动开发 Heroku 服务。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-03-02
    • 1970-01-01
    • 2014-11-08
    • 1970-01-01
    • 1970-01-01
    • 2021-07-05
    • 2018-02-23
    相关资源
    最近更新 更多