我正在使用Aptana Studio 3和Heroku进行一个RoR网站项目。当我通过GitHub提交后将网站推送到Heroku时,我一直收到以下错误。我已经搜索了所有地方,但找不到可以遵循的简单解决方案。有什么建议是出了什么问题以及如何解决?谢谢。
User$ git push heroku master
To git@heroku.com:xxxxxx.git
! [rejected] master -> master (non-fast forward)
error: failed to push some refs to 'git@heroku.com:xxxxxx.git'
To prevent you from losing history, non-fast-forward updates were rejected.
Merge the remote changes before pushing again.
See 'non-fast forward' section of 'git push --help' for details.
User$
我按照@SkillDrick的以下建议尝试了一下,得到了这个结果,但最后出现了错误:
User$ git merge heroku/master master
usage: git merge [options] <remote>...
or: git merge [options] <msg> HEAD <remote>
-n do not show a diffstat at the end of the merge
--stat show a diffstat at the end of the merge
--summary (synonym to --stat)
--log add list of one-line log to merge commit message
--squash create a single commit instead of doing a merge
--commit perform a commit if the merge succeeds (default)
--ff allow fast forward (default)
-s, --strategy <strategy>
merge strategy to use
-m, --message <message>
message to be used for the merge commit (if any)
-v, --verbose be more verbose
-q, --quiet be more quiet
user$ git push heroku master
To git@heroku.com:worrybin.git
! [rejected] master -> master (non-fast forward)
error: failed to push some refs to 'git@heroku.com:worrybin.git'
To prevent you from losing history, non-fast-forward updates were rejected.
Merge the remote changes before pushing again.
See 'non-fast forward' section of 'git push --help' for details.
git merge heroku/master master
(我的错误)并且它显示了usage
等信息时,那是在告诉你命令不正确,因此它实际上没有合并。 - Skilldrick