简体   繁体   English

运行“git push heroku master”时出现错误

[英]I get an error when running “git push heroku master”

After following the official heroku instructions on how to deploy an application, I have run "git push heroku master" but i get the following error:遵循有关如何部署应用程序的官方 heroku 说明后,我运行了“git push heroku master”,但出现以下错误:

To https://git.heroku.com/miguelangelparedes.git
 ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to 'https://git.heroku.com/miguelangelparedes.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

Strangely, after i run "git pull", it says that everything is up to date, and when i push again, i get the same error.奇怪的是,在我运行“git pull”之后,它说一切都是最新的,当我再次推送时,我得到了同样的错误。 Would be nice if someone helped如果有人帮忙就好了

  • Run git pull first and then try the push again.运行git pull然后再试推。
  • If you are the only person using this repository, and you are ABSOLUTELY sure that you version is correct, you can also git push -f , but this will OVERWRITE the server's version, so you have to be very careful.如果你是唯一使用这个存储库的人,并且你绝对确定你的版本是正确的,你也可以git push -f ,但这会覆盖服务器的版本,所以你必须非常小心。

Heroku apps only run off of the master branch of the app repository (local to Heroku). Heroku 应用程序仅在应用程序存储库的主分支(Heroku 本地)之外运行。 If you want to deploy a branch to Heroku which isn't the master branch of your local repo, then you need to specify it Try git push my-branch-name:master.如果你想部署一个分支到 Heroku 这不是你本地仓库的主分支,那么你需要指定它尝试 git push my-branch-name:master。 You'll likely need to add the -f flag to force push.您可能需要添加 -f 标志来强制推送。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 错误-git push heroku master - Error - git push heroku master git push heroku master给我报错 - git push heroku master is giving me an error 我想在 heroku 上托管我的 discord bot,我做的一切都是正确的,但是当我执行 git push heroku 时,我在日志中收到错误 - i want to host my discord bot on heroku and i do everything correct but when i do git push heroku i get error in logs git push heroku master Remote failed - git push heroku master Remote failed git push heroku master 与 node.js 部署挂起 - git push heroku master with node.js deploy hanging React应用程序Heroku构建失败-git push heroku master-预期X,第1行出现解析错误,输入意外结束。 哪个文件的第1行? - React app Heroku build failed - git push heroku master - Expecting X, Parse error on line 1: got unexpected end of input. Line 1 of which file? 尝试将应用程序推送到 Heroku 时,我收到有关版本 5 的 Webpack 错误 - When trying to push application to Heroku, I receive a Webpack error about version 5 在Heroku上运行angularjs种子应用程序时出错 - Error when running angularjs seed app with heroku Angular:如何在运行 Git 推送时强制运行单元测试? - Angular: How to force run unit tests when running Git push? 尝试在Heroku中推送Rails应用并获取JS错误 - Trying to push rails app in heroku and get a js error
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM