Alejandro Veintimilla
Alejandro Veintimilla

Reputation: 11523

Can't pull from Heroku. Couldn't find remote ref master

This is what I did:

heroku git:remote -a myapp

git pull heroku master

fatal: Couldn't find remote ref master

myapp is an existing project, it is not new.

What am I doing wrong? How can I pull from Heroku?. Which branch name should I use?

Edit

The output of git remote -v:

heroku  https://git.heroku.com/myapp.git (fetch)
heroku  https://git.heroku.com/myapp.git (push)
origin  [email protected]:misuper/myapp.git (fetch)
origin  [email protected]:misuper/myapp.git (push)

Also, I tried git clone in a new folder and it gives me the message "You appear to have cloned an empty repository". It is not empty.

And I tried doing the same thing with a different app and it worked correctly.

I'm lost here.

Upvotes: 1

Views: 5616

Answers (1)

gordon
gordon

Reputation: 91

Here are some things to consider, and hopefully get you moving:

  • While Heroku uses 'git' to manage the movement of code to/from Heroku, it is itself not a code repository in the more general sense of Github

  • use heroku git:clone -a your-app-name to clone an existing app into your local project directory

  • use git push heroku master to push your code to Heroku for execution

You should be using Github or some other version control system to manage the actual lifecycle of your source code, eg Pulls, Branches, Merges, &c...

Regarding the error you ran into when trying to execute the heroku git:clone... - how did the application myapp come to be in Heroku in the first place? If you initially created the app using the Heroku Button on a Github repo, there is a bug today which results in the app being created, and the code deployed, but the source is not stored in the internal Heroku repo. If this is the case you will need to

  1. git clone the original repo to a local dir
  2. heroku git:remote -a myapp to add Heroku as a remote repo
  3. git push heroku master to deploy the code to the Heroku repo

Upvotes: 1

Related Questions