推送至Heroku遭到拒绝-“无法将一些引用推送至"heroku" [英] Push to Heroku denied - "failed to push some refs to 'heroku"

查看:108
本文介绍了推送至Heroku遭到拒绝-“无法将一些引用推送至"heroku"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我首先要说我对Heroku完全陌生,现在对我来说,这一切看起来都很陌生.

I should start by saying I'm totally new to Heroku, and it's all looking pretty to foreign to me right now.

无论如何,我已经完成了Heroku入门教程,并上传了一个克隆git repo,并且效果很好.

Anyway, I've done the Heroku getting started tutorial, uploading a clone git repo, and this works fine.

我现在正在尝试用自己的一些代码来完成此任务,但是很挣扎.

I'm now trying to accomplish this with some of my own code, but struggling.

  1. 首先,我进入bash中的应用目录.
  2. 然后我运行heroku create.成功了.
  3. 然后按照教程中的说明运行git push heroku master,并且收到以下错误:
  1. First, I go to my app directory in bash.
  2. Then I run heroku create. This is successful.
  3. I then run git push heroku master as instructed in the tutorial, and I receive the following errors:

error: src refspec master does not match any.

error: failed to push some refs to 'heroku'

如果有人可以解释我在这里缺少什么,将不胜感激?预先感谢.

Would appreciate if someone can explain what I am missing here? Thanks in advance.

推荐答案

似乎您没有正确启动master分支.您提交了文件吗?试试(假设您在master分支上):

It seems that you have not initiated your master branch properly. Have you commited your files? Try (assuming you are on master branch):

git add .
git commit -m "First commit"
git push heroku master:master

另一种更直接的方法是推动HEAD:

Another, more direct approach, is to push the HEAD:

git push heroku HEAD:master

这篇关于推送至Heroku遭到拒绝-“无法将一些引用推送至"heroku"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆