我在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.
答案 0 :(得分:1)
首先拉出主码&然后推送到heroku。
从主人那里拉:
git pull heroku master
然后推送到heroku:
git push heroku master
如果你想强行推送你的代码:
git push heroku master -f
答案 1 :(得分:0)
git pull heroku master
git push heroku master
另外,你可以获取合并和推送。