1

我在 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.
4

2 回答 2

1

首先拉主代码然后推送到heroku。

从 master 拉取:

git pull heroku master

然后推送到 heroku :

git push heroku master

如果你想强制推送你的代码:

git push heroku master -f
于 2016-08-19T12:11:19.473 回答
0
git pull heroku master   
git push heroku master

否则,您可以获取合并和推送。

于 2016-08-19T12:08:44.457 回答