Heroku克隆创建一个空文件夹 [英] Heroku clone creates an empty folder

查看:87
本文介绍了Heroku克隆创建一个空文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,我试图从另一台计算机上学习heroku,昨天我创建了一个应用程序.今天,我正在尝试从另一台计算机克隆该应用程序(下载代码)并继续在同一应用程序上工作,所以我做到了

So I am trying to learn heroku and yesterday from another computer I created an app. Today, from a different computer I am trying to clone the app (download the code) and keep working on the same app so I did this

heroku git:clone -a myappname

我收到消息

警告您似乎克隆了一个空目录

warning you have appeared to have cloned an empty directory

该应用程序正在在线运行,因此代码必须在其中.

The app is running online so the code must be there.

根据文档,此命令可以执行

According to the documentation this command does this

这将创建一个新目录,该目录以您的应用及其源命名 和完整的存储库历史记录,以及添加一个heroku git remote 以便于进一步更新.

This will create a new directory named after your app with its source and complete repository history, as well as adding a heroku git remote to facilitate further updates.

但是,存储库为空.

我看到了以下问题,但对我没用.我如何才能简单地在本地获取代码并继续使用此应用程序而不创建新应用程序?谢谢.

I saw the question below but I that didn't work for me. How can I simply get the code locally and keep working on this app without creating a new one? Thanks.

推荐答案

这是违反直觉的,但看起来是Heroku的设计.您不是从Heroku git复制到本地驱动器,而是从PC复制到Heroku.

This is counterintuitive, but looks like it is by design at Heroku. You don't copy from Heroku git to local drive, but the other way around - from your PC to Heroku.

您需要在本地PC上创建或克隆存储库.

You need to create or clone a repository on your local PC.

git create <new repository>

git clone <source>

然后初始化您的存储库并提交代码:

then init your repository and commit code:

$ cd myapp
$ git init
Initialized empty Git repository in .git/
$ git add .
$ git commit -m "my first commit"

然后,您需要将存储库与Heroku链接.下载他们的工具带并运行:

Then you need to link your repository with Heroku. Download their Toolbelt and run:

heroku git:remote -a your_app_name_on_heroku

并部署代码:

 git push heroku master

希望有帮助.为了解决这个问题,我不得不在Heroku开张票.查看 Heroku Git说明以获取更多参考.

Hope that helps. I had to open a ticket at Heroku to figure this out. Check Heroku Git instructions for further reference.

这篇关于Heroku克隆创建一个空文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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