繁体   English   中英

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

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

遵循有关如何部署应用程序的官方 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.

奇怪的是,在我运行“git pull”之后,它说一切都是最新的,当我再次推送时,我得到了同样的错误。 如果有人帮忙就好了

  • 运行git pull然后再试推。
  • 如果你是唯一使用这个存储库的人,并且你绝对确定你的版本是正确的,你也可以git push -f ,但这会覆盖服务器的版本,所以你必须非常小心。

Heroku 应用程序仅在应用程序存储库的主分支(Heroku 本地)之外运行。 如果你想部署一个分支到 Heroku 这不是你本地仓库的主分支,那么你需要指定它尝试 git push my-branch-name:master。 您可能需要添加 -f 标志来强制推送。

暂无
暂无

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM