Development Stickies

Development Notes for Web Programmers…

How to migrate from SVN to git (on Mac OS X)?

Actually it is quite obvious, but this is how it worked absolutely fine for me:

  • Locally you need git and the svn extension (git-svn). I use Mac OSX 10.6 (Snow Leopard) and I used:
    sudo port selfupdate
    sudo port upgrade outdated
    sudo port install git-core +svn
  • Then you clone the whole Subversion SVN repository to a local git repository.
    Create a new empty directory for the local git repo:

    </pre>
    mkdir <target>
    cd <target>
    <pre>
  • Then clone the SVN:
    git svn clone https:// .
  • In my case the initial cloning timed out. In this case, I continued with a fetch, which ran without issues:
    git svn fetch https:// .
Then you have to wait some minutes, depending on the size of the SVN repo and its history, but at the end you have complete clone where each SVN commit is stored as git tag.
You can have a look at the new repo via:
  • cd 
  • gitk --all

Leave a comment