heroku git:clone 创建空存储库 [英] heroku git:clone creates empty repository

查看:23
本文介绍了heroku git:clone 创建空存储库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在从 heroku 检索当前应用程序代码时遇到问题.我认为 Heroku 搞砸了,但他们的支持尚未回复(3 天和计数).但也许其他人知道可能出了什么问题,或者我可以尝试其他什么.

I'm having problems retrieving the current application code from heroku. I think it is messed up at Heroku but their support hasn't replied yet (3 days and counting). But maybe someone else has an idea what might be wrong or if there is something else I could try.

终端输出:

$ heroku git:clone -a APPNAME
Cloning from app 'APPNAME'...
Cloning into 'APPNAME'...
warning: You appear to have cloned an empty repository.


$ git pull
Your configuration specifies to merge with the ref 'master'
from the remote, but no such ref was fetched.

.git/config 看起来不错,但本地目录没有分支或其他内容.

.git/config looks fine but the local directory has no branches or other content.

更新问题确实是一个损坏的 git 存储库.Heroku 支持重新初始化了解决所有问题的存储库.

Update The issue was indeed a corrupt git repository. Heroku support re-initialized the repository which fixed all problems.

推荐答案

摘自https://help.heroku.com/XOBUHLKQ/why-do-i-see-a-message-you-appear-to-have-cloned-an-empty-repository-when-using-heroku-git-clone

为什么当通过我们的平台 API 部署到您的应用程序时会出现此错误消息 - 通常这些部署来自单击 Heroku 按钮.

Why This error message occurs when deploys to your application have been made via our platform API - typically these are deploys from a Heroku Button click.

  • 使用 Heroku Button 部署应用程序并记住您创建的应用程序名称.

  • Deploy the app with Heroku Button and remember the app name that you created.

回到显示 Heroku 按钮的位置并复制它的底层 URL,例如https://heroku.com/deploy?template=https://github.com/jamesward/heroku-connect-phone-change

Go back to where the Heroku Button was displayed and copy it's underlying URL eg https://heroku.com/deploy?template=https://github.com/jamesward/heroku-connect-phone-change

现在提取 https://github.com 部分,因此从上面的示例中您将剩下和https://github.com/jamesward/heroku-connect-phone-change

Now extract the https://github.com part so from the above example you'd be left with https://github.com/jamesward/heroku-connect-phone-change

使用 heroku git:clone -a <YOUR-APP-NAME> 克隆存储库 - 它将被报告为空 - 没关系 cd 进入项目并添加一个 git远程指向原始来源,

Clone the repo with heroku git:clone -a <YOUR-APP-NAME> - it will be reported as empty - that's ok cd into the project and add a git remote pointing at the original source,

git remote add originhttps://github.com/jamesward/heroku-connect-phone-change

从远程源拉取

git pull origin master

您现在将拥有已部署应用程序的代码,您可以在本地对其进行更改并将其部署回 Heroku.

You will now have the code for the deployed application and you can make changes to it locally and deploy it back to Heroku.

这篇关于heroku git:clone 创建空存储库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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