Search code examples
gitgithubgoogle-code

Migrate git repo from Google Code to Github


I have a git project hosted on Google Code. I'd like to move it to Github, with the revision history included. I don't use the ticket system so that won't matter.

In similar questions like mine, the problem is migrating from a SVN repo in Google Code to Github. I'm already using git.

I have the project checked out on my machine because I'm developing on it. From what I understood from git, my local project already includes the full history because of its distributed nature. So maybe copying it to github is really simple, but I don't know the steps.

Of course the idea is that new changes will be pushed to Github and the Google code repository would remain frozen.


Solution

  • Create a github repository, and make sure your SSH key, etc... is installed properly.

    Check out your repository from google.

    Run:

    git remote add github <URL FROM GITHUB>
    git push github HEAD
    

    That will push your current branch. You can push others by switching to them and repeating the git push github HEAD (or other, more advanced ways).