Can I import my heroku git repo into bitbuket? and

2019-07-13 16:02发布

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).

1条回答
2楼-- · 2019-07-13 16:56

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
查看更多
登录 后发表回答