When Git tells you it failed to push some refs

opencourse 2012-05-21 06:31:22
当我尝试部署网站到Heroku.com时遇到以下错误警告
$git push heroku master //master是branch的名字,第一次提交需要使用master.
heroku receiving push
!heroku push rejected,repository is empty.
to git@heroku.com:faculty.git
![remote rejected]master->master(pre-receive hook declined)
Error: failed to push some refs to git@heroku.com:faculty.git

当我$git push git@heroku.com:faculty.git
fatal:Couldn't fine remote ref HEAD

这个HEAD是存在的,我曾经查看过,发这个帖子的时候忘了它在哪个文件中。这里有篇文章可供参考http://edspencer.net/2008/04/when-git-tells-you-it-failed-to-push.html
谢谢!
...全文
801 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
opencourse 2012-05-23
  • 打赏
  • 举报
回复
我想你们并没有就我提及的问题有针对性地给出解决方法。RADIANT是一个CMS, 它已经被做成GEM,可以快速安装。我对GIT不熟悉,不知道你们的办法是否是对网上教程的补充。我已经申请了名为faculty的应用,理论上可通过faculty.heroku.com进行访问。在WINDOWS下,development-kit和 sqlite3已经安装,radiant的模板数据库已经初始化完毕, ssh key已经创建并添加到Heroku.
我查了$git config --list
remote heroku url=git@heroku:faculty.git
remote heroku fetch=+rdfs/head/*:refs/remote/heroku*
remote origin url=git@heroku:faculty.git
remote origin fetch=+rdfs/head/*:refs/remote/heroku*

请问heroku push rejected,repository is empty的情况应该怎样应对?谢谢
langkejx 2012-05-22
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 的回复:]
之前有没有执行过以下命令啊:
git remote add origin git@github.com:<your name>/<appname>

第一次需要origin,添加repository,之后才向repository push你的代码。

我一般是push到github之后,再git push heroku部署到heroku上。
[/Quote]


不错...
骄傲青蛙 2012-05-22
  • 打赏
  • 举报
回复
Step 1

$ heroku create --stack cedar


Step 2

$ git push heroku master
evainexia 2012-05-22
  • 打赏
  • 举报
回复
之前有没有执行过以下命令啊:
git remote add origin git@github.com:<your name>/<appname>

第一次需要origin,添加repository,之后才向repository push你的代码。

我一般是push到github之后,再git push heroku部署到heroku上。

2,763

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 Ruby/Rails
社区管理员
  • Ruby/Rails社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧