Thursday, July 07, 2011

How hard is migrating SVN to GIT... a zillion posts all of which half work. Here's mine... the heavy lifting is done by these scripts (I'm assuming a static users.txt - I'm pulling from a corporate AD to build mine):

(cd /tmp && git clone https://github.com/nothingmuch/git-svn-abandon.git)
git svn clone --no-metadata --prefix=svn/ --stdlayout --authors-file=users.txt https://svn/project project.git-svn
cd project.git-svn/
PATH=/tmp/git-svn-abandon:$PATH git svn-abandon-fix-refs
PATH=/tmp/git-svn-abandon:$PATH git svn-abandon-cleanup
git config --remove-section svn
git config --remove-section svn-remote.svn
ls -RC .git/svn .git/{logs/,}refs/remotes/svn/
rm -rf .git/svn .git/{logs/,}refs/remotes/svn/
git remote add origin ssh://akiernan@github.com/project 
git push --all
git push --tags