3

My laptop died and I need to code from another computer.

I am working with Heroku and I want to get the latest version of code from Heroku to another machine.

I understood that it is very recommended to get a proper remote repository using GitHub or BitBucket.

I decided to try BitBucket.

While creating my account, it asks for the old URL of my git repo. Since my machine is dead, I was hoping to fill in the heroku URL but that didn't work.

Any ideas how to proceed?

The idea is that I could pull and push my changes from either machines (when my laptop comes from repair).

zabumba
  • 12,172
  • 16
  • 72
  • 129

1 Answers1

5

You can simply clone your Heroku repository to your local machine. Then add BitBucket as a remote and push the code there.

Find out the Heroku repo url on the settings page of your app

https://dashboard.heroku.com/apps/[APP]/settings

git clone git@heroku.com:[APP].git
git remote add bitbucket ssh://git@bitbucket.org/[ACCOUNT]/[REPO].git
git push bitbucket master
iltempo
  • 15,718
  • 8
  • 61
  • 72
  • Ooops! I am still one problem. I get this message on last command: conq: repository access denied. access via a deployment key is read-only. – zabumba Nov 09 '12 at 01:33
  • 1
    Use your "normal" ssh key instead of the one you use for deployment. If you lost your key as well you can find help to add a new one here: https://devcenter.heroku.com/articles/keys – iltempo Nov 09 '12 at 01:36
  • I did generate a new key on this machine and added heroku keys:add ./id_rsa.pub\ I am getting this message while pushing the local to bitbucket where I also added my public key. I haven't tried a deploy to heroky yet. BTW "normal" meaning "public key"? – zabumba Nov 09 '12 at 01:47
  • 1
    With "normal" I mean the key that you are pushing with, not the one specified as a deployment key on BitBucket. – iltempo Nov 09 '12 at 01:51
  • I think I am lacking knowledge here. I am afraid I don't know how to figure out this key and how to use it to fix my push. – zabumba Nov 09 '12 at 01:58
  • I have been reading the docs inside out, I just don't get what it the "normal" key, and how to use this normal key to do my push. Would you recommend to open a new question? it's 4am in Germany, I give up for now and give another try tomorrow. – zabumba Nov 09 '12 at 02:49
  • Ended up adding another question: http://stackoverflow.com/questions/13306435/repository-access-denied-access-via-a-deployment-key-is-read-only – zabumba Nov 09 '12 at 13:32
  • Got it and resolved it. Set SSH Key in BitBucket account ... not the specific Deployment Key! I am new to BitBucket and it was late. Apologies. Milles Mercis! – zabumba Nov 09 '12 at 14:26