【发布时间】:2016-12-26 13:50:58
【问题描述】:
我在 Heroku 上部署了一个应用程序。我简单地将应用程序克隆到 cloud9 IDE 上进行一些更改,如下所示:
heroku git:clone -a myApp
之后我尝试按照以下方式推送更改:
$ git add .
$ git commit -am "make it better"
$ git push heroku master
它给了我以下错误:
To https://git.heroku.com/myApp
! [rejected] master -> master (fetch first)
error: failed to push some refs to 'https://git.heroku.com/myApp'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
【问题讨论】:
-
git pull heroku master然后推送。或者使用强制选项git push heroku master -f。 -
@Tushar 感谢 force 选项解决了这个问题,如果作为答案发布我可以接受并关闭问题。
标签: javascript node.js git heroku cloud9