Trying to heroku git:clone after heroku fork yields an empty repository
Asked Answered
S

1

17

I just ran:

$ heroku fork -a oldapp newclonedapp

and it worked fine and runs etc. Now I want to pull the code down to work on it [I realize heroku is not for version control and I usually use github for this but in this case I need to get the code from the clone] and when I try:

$ heroku git:clone -a newclonedapp

I get:

warning you have appeared to have cloned an empty directory

and the new newclonedapp directory is empty indeed.

what am I doing wrong?

Spalla answered 11/9, 2013 at 20:52 Comment(0)
D
34

You're not doing anything wrong, it's a known issue of fork that it doesn't clone the source app repository. Until the issue is resolved, you'll need to manually clone the source repository. Here's how I'd do it:

$ git clone [email protected]:oldapp.git -o old newclonedapp
$ cd newclonedapp
$ heroku git:remote -a newclonedapp
$ git push heroku master

Basically, you clone the original repo to a new app directory, setup the heroku git remote and push to it to populate the new app repo.

Deductive answered 12/9, 2013 at 14:8 Comment(5)
Looks like they've decided it's a feature. Wish they'd update docs to make it clear it doesn't handle this for you.Popedom
This is great! But it seems that when I navigate into folder newcloneapp (even when manually moving this folder to its own director), Heroku still required me to specify an app name. Any idea why ?Winther
As far as I can tell from reading it, it is still a valid request and someone needs to make a ticket: the request is that Heroku will copy the source over on the server-side.Hollands
i got this error :error: src refspec master does not match any any idea ? thanks in advance..Continuator
@ErikReppen What if I have deleted my source code from git?Euphemize

© 2022 - 2024 — McMap. All rights reserved.