【问题标题】:Heroku: Pushing an update from a source branch that is not mainHeroku:从非主源分支推送更新
【发布时间】:2020-10-14 19:44:46
【问题描述】:

我正在尝试将我的应用程序上传到 heroku,但 heroku/python buildpack 没有构建我的应用程序并说它与它不兼容,我有一个 Procfile 和一个 requirements.txt 文件。添加并提交了所有必需的文件,该应用程序在我的本地计算机上完美运行。

这是需求文件:

这是 Procfile:

这是输出:

$ git push heroku master
Enumerating objects: 197, done.
Counting objects: 100% (197/197), done.
Delta compression using up to 4 threads
Compressing objects: 100% (189/189), done.
Writing objects: 100% (197/197), 51.94 KiB | 2.16 MiB/s, done.
Total 197 (delta 93), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> App not compatible with buildpack: https://buildpack-registry.s3.amazonaws.com/buildpacks/heroku/python.tgz
remote:        More info: https://devcenter.heroku.com/articles/buildpacks#detection-failure
remote:
remote:  !     Push failed
remote: !
remote:  ! ## Warning - The same version of this code has already been built: 644afa937ebb796a0ba0e2c8f3a459f4accbac36
remote:  !
remote:  ! We have detected that you have triggered a build from source code with version 644afa937ebb796a0ba0e2c8f3a459f4accbac36
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
remote:
remote: Verifying deploy...
remote:
remote: !       Push rejected to botsenior.
remote:

文件夹本身如下所示:

我已经尽我所能来解决这个问题。我多次删除了 heroku 应用程序并再次创建它,我尝试更改 requirements.txt 文件中的模块版本,但似乎没有任何效果。非常感谢您的帮助
注意:我正在从不是本地 git 存储库上的主分支的源分支推送,但我正在将其推送到 heroku 远程存储库上的主分支.我不知道这是否是个问题,但我认为指定这一点很重要

【问题讨论】:

  • git push heroku master 你不是从源分支推送。您正在将本地 master 分支推送到远程 master 分支。
  • @TinNguyen master 是远程存储库的 master 分支,我从本地不同的分支推送。我忘了说明我已经签出到我想要的分支。
  • 使用该命令,您仍在将本地 master 分支推送到远程 master 分支。如果要将本地 dev 分支推送到远程 master 分支,请执行以下操作:git push heroku dev:master
  • @TinNguyen 你太棒了,谢谢!

标签: python git heroku discord.py


【解决方案1】:

为了从非 master 的本地分支推送,您必须指定源分支和目标分支并用冒号分隔它们:

git push heroku <source>:<target>

【讨论】:

    猜你喜欢
    • 2016-06-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-11-21
    • 1970-01-01
    • 1970-01-01
    • 2020-12-01
    • 1970-01-01
    相关资源
    最近更新 更多