我正在一个网站上工作。我使用heroku运行服务器,并使用bitbucket作为版本控制工具。我设置了一个直接从bitbucket部署到heroku的管道。但我不断收到类似这样的错误:
+ git push https://heroku:$HEROKU_API_KEY@git.heroku.com/$HEROKU_APP_NAME.git HEAD
To https://heroku:57eb7889-7395-4a7e-bd95-1312a40b30d1@git.heroku.com/hidden-ocean-90048.git
! [rejected] HEAD -> master (non-fast-forward)
error: failed to push some refs to 'https://heroku:57eb7889-7395-4a7e-bd95-1312a40b30d1@git.heroku.com/hidden-ocean-90048.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 -f,但是不起作用。请帮助我。
答案 0 :(得分:1)
您可以使用-f进行如下操作:
git push -f https://heroku:$HEROKU_API_KEY@git.heroku.com/$HEROKU_APP_NAME.git HEAD