[英]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
如果有人帮忙就好了
git pull
first and then try the push again.git pull
然后再试推。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.