How to migrate a git repository from GitHub to Gitorious
The other day I had to move a git repository from GitHub to Gitorious and after cracking my head against the wall about this problem for a little while, I think I came up with a pretty elegant solution.
Here are some of the assumptions we are making in this turtorial:
- You already have a GitHub and a Gitorious account
- You have an existing GitHub repo that you want to move
- We will use this repo as the example
Now follow these steps:
- Login to Gitorious and create a new Project with a Repo
- Find a location on your local system and create a new folder called
XmlTidy. I usually do this at
~/Projects
- Drop into your new folder and initialize a new git repo in it
- Add a remote reference to your GitHub repository called
origin
- Pull all code from the
master
branch inorigin
- Add a remote reference to your Gitorious repository called
destination
- Push your local
master
branch to thedestination
remote repo
Here's the complete code listing for the above narrative:
mkdir ~/Projects/XmlTidy cd ~/Projects/XmlTidy git init . git remote add origin git@github.com:gorauskas/XmlTidy.git git pull origin master git remote add destination git@gitorious.org:xmltidy/xmltidy.git git push destination master
That's it... You're done!
Comments
Comments powered by Disqus