尝试git push to remote branch时遇到错误(Heroku)

时间:2013-03-12 19:27:09

标签: heroku github git-push

您好我尝试将我的本地更改推送到heroku生产但是我收到以下错误

Zhens-MacBook-Pro:Dailymuses-Server-Side zaikshev88$ git push heroku-production master:master
To git@heroku.com:dailymuses.git
! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to 'git@heroku.com:dailymuses.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Merge the remote changes (e.g. 'git pull')
hint: before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

这里的问题是,当我尝试做一个git pull时,我被告知一切都是最新的

Zhens-MacBook-Pro:Dailymuses-Server-Side zaikshev88$ git pull origin master
From github.com:mingyeow/Dailymuses-Server-Side
* branch            master     -> FETCH_HEAD
Already up-to-date.

这里有什么问题,如何解决?

1 个答案:

答案 0 :(得分:10)

您的push命令是远程heroku-production,但pull命令是originnon-fast-foward消息表示当前仓库中的历史记录与Heroku遥控器不同;可能有人推出了一些合并或重组的分支机构。

我恳请你不要使用Heroku作为权威的git遥控器。假设你不是,你可以强行推动Heroku master分支来解决这个问题。

git push -f heroku-production master:master