【发布时间】:2015-05-19 09:32:31
【问题描述】:
我正在学习 Michael Hartl 制作的教程,但我倾向于在 Linux 上进行很多发行版。我从 github 克隆了我的 repo,我做得很好。但是我不能再推送到heroku,我不确定为什么……
这是我要运行的命令:
$ bundle exec rake test
$ git add -A
$ git commit -m "Use SSL and the Puma webserver in production"
$ git push
$ git push heroku
$ heroku run rake db:migrate
在最后一部分之前一切正常:
git push heroku
warning: push.default is unset; its implicit value is changing in
Git 2.0 from 'matching' to 'simple'. To squelch this message
and maintain the current behavior after the default changes, use:
git config --global push.default matching
To squelch this message and adopt the new behavior now, use:
git config --global push.default simple
When push.default is set to 'matching', git will push local branches
to the remote branches that already exist with the same name.
In Git 2.0, Git will default to the more conservative 'simple'
behavior, which only pushes the current branch to the corresponding
remote branch that 'git pull' uses to update the current branch.
See 'git help config' and search for 'push.default' for further information.
(the 'simple' mode was introduced in Git 1.7.11. Use the similar mode
'current' instead of 'simple' if you sometimes use older versions of Git)
To git@heroku.com:morning-stream-6357.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'git@heroku.com:morning-stream-6357.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.
我完全不确定如何解决这个问题:/ 有人可以帮忙吗?我对此进行了研究,并使用以下方法添加了远程 heroku 存储库:
git remote add heroku-remote git@heroku.com:project.git
当然要为我的代码修改它是这样的:
git remote add heroku-remote git@heroku.com:morning-stream-6357.git
但是我仍然无法从命令行推送,我一直在使用 heroku 部署按钮进行推送,该按钮可以让我部署 master 分支,但我认为这不是一个好主意,否则我认为会在这本书。任何帮助都将不胜感激。
编辑:如果有人想知道,我确实安装了 heroku 工具带。
编辑:我之前应该注意到我确实已经尝试过运行这个命令:
git push heroku master
但它仍然给我一个错误:
jose@jose-desktop:~/Workspace/sample_app$ git push heroku master
To git@heroku.com:morning-stream-6357.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'git@heroku.com:morning-stream-6357.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.
我不确定是什么原因造成的,它应该是最新的。我克隆了 repo,之前我已经从 heroku 的 github 连接手动部署,所以它应该是最新的。
git pull
结果如下:
jose@jose-desktop:~/Workspace/sample_app$ git pull
Already up-to-date.
【问题讨论】:
-
你拉的像它说的那样吗?
-
hint: 'git pull ...') 在再次推送之前。
标签: ruby-on-rails git heroku github heroku-toolbelt