[英]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.