【问题标题】:Heroku Git Push Master ErrorHeroku Git Push Master 错误
【发布时间】: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


【解决方案1】:
git pull heroku master   
git push heroku master

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

【讨论】:

    【解决方案2】:

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

    从主人那里拉出来:

    git pull heroku master
    

    然后推送到heroku:

    git push heroku master
    

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

    git push heroku master -f
    

    【讨论】:

      猜你喜欢
      • 2013-02-03
      • 1970-01-01
      • 2016-02-19
      • 2014-07-05
      • 1970-01-01
      • 2019-10-14
      • 1970-01-01
      • 2011-05-23
      • 2014-10-26
      相关资源
      最近更新 更多