Skip to content

Instantly share code, notes, and snippets.

@harperreed
Created April 4, 2011 04:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save harperreed/901116 to your computer and use it in GitHub Desktop.
Save harperreed/901116 to your computer and use it in GitHub Desktop.
A simple bundle of scripts to migrate from svn to git for instance: your repo path is: /trunk/app/vendors/ you would do: sh strip_svn.sh svn.dump trunk/app/vendors vendors.dump this would create a dump file called vendors that is just the comm
#!/usr/bin/env bash
authors=$(svn log -q | grep -e '^r' | awk 'BEGIN { FS = "|" } ; { print $2 }' | sort | uniq)
for author in ${authors}; do
echo "${author} = NAME <USER@DOMAIN>";
done
svnadmin create $1_repo
cat $1 |svnadmin load $1_repo
git svn --authors-file=authors.txt clone file:///$1/$2_repo/ $2_git
cat $1.dump | svndumpfilter include $2 >$3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment