Cheatsheet: PicketLink: Migration from SVN to GIT


    NOTEOn April 24, 2014,  Anil undertook a svn migration of the picketbox project to github.  It is documented at https://gist.github.com/anilsaldhana/11271541

    That is the most recent experience that has gone very well. Please follow that process rather than the one listed here.


    I was primarily helped a lot by Emmanuel Bernhard's blog post: http://emmanuelbernard.com/blog/2010/05/31/git-how-my-life-has-improved-since-last-month-when-i-used-svn/

     

    Step 1:  Determine your svn url

     

    Step 2:  Create a directory such as "integration-tests"

     

    Step 3: cd to the created directory.

     

    Step 4: Create a script (or you can run it from the cmd line).

     

    git svn init --trunk=https://svn.jboss.org/repos/picketlink/integration-tests/trunk/ \
                 --tags=https://svn.jboss.org/repos/picketlink/integration-tests/tags \
                 --branches=https://svn.jboss.org/repos/picketlink/integration-tests/branches \
                 https://svn.jboss.org/repos/picketlink/integration-tests/trunk/
    

     

    Let me call this script migrate.sh

     

    NOTE:  you may need to have git-svn installed on your linux box.   (Do    sudo yum install git-svn)

     

    Step 5:  Run the script.  This should initialize a git repo in the created directory.

     

    Step 6: Create a users file

     

    mmoyses = Marcus Moyses <email address of marcus>
    sguilhen = Stefan Guilhen <email address of stefan>
    anil.saldhana@jboss.com = Anil Saldhana <email address of anil>
    

     

    Let me call it users.txt

     

    Step 7: Set the users file in the git config as follows:

     

    git config svn.authorsfile path/to/users.txt
    

     

    Step 8:  Migrate the svn repo

     

    git svn fetch
    

     

    This will take some time.  If you are missing user mapping, update your users.txt

     

    Troubleshooting:

     

    Kabir Khan's Tip::
    
    I was getting some problems where the 'git svn fetch' would bomb out with the following "useful" error message:
    Assertion failed: (svn_path_is_canonical(component, pool)), function svn_path_join, file subversion/libsvn_subr/path.c, line 115.
    error: git-svn died of signal 6
    Modifying the following of .git/config
            branches = projects/cl-benchmark/branches//*:refs/remotes/*
            tags = projects/cl-benchmark/tags//*:refs/remotes/tags/*
    to
            branches = projects/cl-benchmark/branches/*:refs/remotes/*
            tags = projects/cl-benchmark/tags/*:refs/remotes/tags/*
    Fixes it (thanks Carlo!)
    
    

     

    Step 9:  Create a repository in your account on github

     

    Step 10: Set the remote url

     

    $ git remote add upstream git@github.com:anilsaldhana/integration-tests.git
    

     

    Step 11:  Push to the upstream

     

    $ git push -f  upstream
    

     

    Note:  If there are issues such as "No refs in common and none specified; doing nothing.",  then do  git push -f upstream master

     

    It will take some time to upload the objects.