推送到 Heroku 被拒绝 - “未能将一些引用推送到‘heroku’"; [英] Push to Heroku denied - "failed to push some refs to 'heroku"

查看:36
本文介绍了推送到 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 存储库,并且效果很好.

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 不匹配任何.

错误:无法将一些引用推送到heroku"

如果有人能解释我在这里遗漏了什么,我会很感激吗?提前致谢.

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

推荐答案

看来你没有正确启动你的主分支.你提交文件了吗?尝试(假设您在 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天全站免登陆