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.

  • Python way to clone a git repository
  • How do I fix “Cannot pull into a repository with state: MERGING” in EGit?
  • Branch name within git post hook
  • How do I .gitignore and delete an already committed file without affecting other working copies?
  • Checkout git repo with chef with ssh key
  • How do I export a git log to a text file?
  • 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.

  • code push to heroku not working
  • What are the differences between double-dot “..” and triple-dot “…” in Git commit ranges?
  • Retrieving git log in YYYY-MM-DD format in local time zone
  • git pull says up-to-date but git push rejects non-fast forward
  • Firedrill: Recreate central git repository from developers clones
  • Using Composer and Private Repository on GitHub using VCS on Build Server
  • 3 Solutions collect form web for “Migrate git repo from Google Code to Github”

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

    On Github create an empty repository, push your local repository to it — done.

    At that point if you want all future pushes to go to Github, change the origin remote to point to the Github repository instead of the one at Google Code — or you can clone a new working repository from Github.

    You can use Google Code export to GitHub feature.

    Git Baby is a git and github fan, let's start git clone.