Heroku:在Cloud9 IDE上“推送拒绝,存储库为空”

时间:2013-07-25 17:20:29

标签: heroku cloud9-ide

我正在使用Cloud9 IDE,我只是尝试部署到Heroku,但是我收到了这个错误:

[1/5] Verifying preconditions...
[2/5] Updating repository...
[3/5] Pushing to Heroku...
1:: Warning: Permanently added the RSA host key for IP address '50.19.85.154' to the list of known hosts.
!     Push rejected, repository is empty
To git@heroku.com:anthro-site.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@heroku.com:anthro-site.git'

我环顾四周,发现这里有几个相似的问题,例如this one,但不幸的是,这个问题的答案要求我安装软件,我不认为我可以这样做在Cloud9上。我似乎无法访问heroku命令,因此不能为我安装它。我该怎么办?

2 个答案:

答案 0 :(得分:2)

显然您可以在Cloud9上安装Heroku客户端,如here所述:

  
    

要部署到Heroku,请键入以下命令:

wget http://assets.heroku.com/heroku-client/heroku-client.tgz
tar xzfv heroku-client.tgz
cd heroku-client/bin
PATH=$PATH:$PWD
         

现在,您可以在项目中使用heroku命令,如Heroku文档中所述。

  

但这不是我的问题。似乎为了推送到heroku,你必须在你的master分支上。我的步骤如下:

$ git checkout master
$ git merge dev # that's the branch I was working on
                # if you don't merge, master will not have whatever
                # commits you've made to the branch you were on.
$ git push --set-upstream heroku master

之后,我等待Heroku完成我的应用程序的安装,现在我可以访问它了。

答案 1 :(得分:0)

https://devcenter.heroku.com/articles/git#deploying-code

  

除了主人之外被推到Heroku的分支将被忽略   命令。如果你在本地工作,你可以   要么在推送之前合并到主人,要么指定你想要的   将本地分支推送到远程主服务器。推动除了以外的分支   master,使用以下语法:

     

$ git push heroku yourbranch:master

它对我有用。

相关问题