Saturday, June 8, 2013

Fork a git project from Google Code to GitHub

How to fork a git project from Google Code to GitHub:
  1. Create new repo on http://github.com as follows: https://help.github.com/articles/creating-a-new-repository
  2. Clone the project:

         $ git clone https://code.google.com/p/<PROJECT>/
  3. Set the remote origin url:
     $ git remote set-url origin https://github.com/<USER>/<PROJECT>.git
Now you can do local changes and commits. Push commits:
$ git push origin master
To stay synced, setup upstream repository:
$ git remote add upstream https://code.google.com/p/<PROJECT>/
$ git remote -v
Now you can fetch the remote repository updates from the Google Code and merge its changes into the local branch:
$ git fetch upstream
$ git merge upstream/master
Fix conflicts if necessary.

No comments:

Post a Comment