Can I import my heroku git repo into bitbuket? and how?

允我心安 提交于 2019-12-10 19:08:24

问题


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:


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


来源:https://stackoverflow.com/questions/13300068/can-i-import-my-heroku-git-repo-into-bitbuket-and-how

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!