Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

heroku git:clone creates empty repository

Tags:

git

heroku

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.

terminal output:

$ 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 looks fine but the local directory has no branches or other content.


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

like image 896
Ronny Avatar asked Dec 10 '12 16:12

Ronny


2 Answers

You can use heroku slog download. Please refer https://help.heroku.com/FZDDCBLB/how-can-i-download-my-code-from-heroku.

First, install the heroku-slugs CLI plugin with

heroku plugins:install heroku-slugs

, then run:

heroku slugs:download -a APP_NAME

This will download and compress your slug into a directory with the app name.

like image 173
Neeraj Kumar Avatar answered Sep 30 '22 14:09

Neeraj Kumar


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

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.

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

  • 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

  • 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

  • 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 origin https://github.com/jamesward/heroku-connect-phone-change

  • pull from the remote origin

    git pull origin master

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

like image 42
Jaime Agudo Avatar answered Sep 30 '22 13:09

Jaime Agudo