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
I get the message
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
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.
However, the repository is empty.
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.
Why am I getting an empty repo when cloning my keystone app to local repo from 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.
You need to create or clone a repository on your local PC.
git create <new repository>
OR
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"
Then you need to link your repository with Heroku. Download their Toolbelt and run:
heroku git:remote -a your_app_name_on_heroku
And deploy code:
git push heroku master
Hope that helps. I had to open a ticket at Heroku to figure this out. Check Heroku Git instructions for further reference.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With