Moving a project from google code to github

Finally moved my old cmakeant project from google-code to github (I have been meaning to do this for ages). In case you are trying to do the same, here are the steps.

Posted by Iain Hull on Monday, October 29, 2012

Finally moved my old cmakeant project from google-code to github (I have been meaning to do this for ages). In case you are trying to do the same, here are the steps:

  1. Download the mercurial repo from google code

     hg clone https://iainhull@code.google.com/p/cmakeant/ cmakeant-hg
    
  2. Use fast-export to convert the mercurial repository to git. Note: I needed to add mercurial on my PYTHONPATH

     git clone git://repo.or.cz/fast-export.git
     export PYTHONPATH=/usr/local/Cellar/mercurial//2.3.1/libexec/:$PYTHONPATH    
    
  3. Create a new git repo and clone the mercurial repo

     git init cmakeant-git
     cd cmakeant-git
     ../fast-export/hg-fast-export.sh -r ../cmakeant-hg/
    
  4. Create .gitignore, readme and license and commit any changes

     cp .hgignore .gitignore
     vi .gitignore
     vi README.md
     wget http://www.apache.org/licenses/LICENSE-2.0.txt
     git add -n .
     # verify files added
     git add .
     git commit
    
  5. Create a new repo on github (using the web interface).

  6. Set the origin on your local repo and push the changes to github

     git remote add origin https://github.com/IainHull/cmakeant.git
     git push -u origin master
    
  7. Finally move the issues from the google code tracker to github. (I found some alpha code that could do this, but decided to import the few issues I had manually).