Heroku:如果要在分支上进行开发并通过git进行部署,则必须运行: [英] Heroku: If you are developing on a branch and deploying via git you must run:

查看:65
本文介绍了Heroku:如果要在分支上进行开发并通过git进行部署,则必须运行:的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Heroku认为我在不同的分支"上,但我不在(并且相同版本的代码绝对没有如所声称的那样被构建"):

Heroku thinks I'm on a "different branch", but I am not (and the same version of the code most definitely has not "been built" as claimed):

remote:  ! ## Warning - The same version of this code has already been built: e437cb472232ed140fa6dd710e8b4a6b16b8b213
remote:  !
remote:  ! We have detected that you have triggered a build from source code with version e437cb472232ec180fa6dd700e8b4a6b1ab8b213
remote:  ! at least twice. One common cause of this behavior is attempting to deploy code from a different branch.
remote:  !
remote:  ! If you are developing on a branch and deploying via git you must run:
remote:  !
remote:  !     git push heroku <branchname>:main
remote:  !
remote:  ! This article goes into details on the behavior:
remote:  !   https://devcenter.heroku.com/articles/duplicate-build-version

提到的文章

本文是正在进行中的工作,或记录了尚未发布给所有用户的功能.该文章未列出.只有知道链接的人才能访问它.

This article is a work in progress, or documents a feature that is not yet released to all users. This article is unlisted. Only those with the link can access it.

无论如何,我都跑了

git push heroku master:main

根据请求发出警告,但仍进行了部署(这在 git push heroku master 之前是没有做到的).

as requested and it gave the warning but deployed anyway (which it wasn't doing before with git push heroku master).

已部署该应用程序,这意味着问题已解决.但是我对这里发生的事情感到困惑,如果没有上面的特殊命令,将导致应用程序无法部署.

The app deployed, which means the problem is solved. But I am confused as to what happened here to cause the app to not deploy without the special command above.

我不确定这是heroku的怪异问题还是github上的新变化?(我知道他们打算将主"一词更改为主"-我想知道这是原因吗?或者这仅仅是对heroku的某些更改,可能只是参考文章上给出的消息的临时更改?)

I am not sure if this is some weird problem with heroku or if it's some new change at github? (I know they were planning to change the word 'master' to 'main' - I wonder if that is the reason?, or if this is simply some changes to heroku, possibly just temporary ones given the message on the referenced article?)

推荐答案

对我有用的是

git push heroku master:main

一切正常

(不确定为什么要这么做)

(not sure why this was necessary though)

这篇关于Heroku:如果要在分支上进行开发并通过git进行部署,则必须运行:的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆