Skip to content

Instantly share code, notes, and snippets.

@cscorley
Created November 30, 2011 18:41
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save cscorley/1410217 to your computer and use it in GitHub Desktop.
Save cscorley/1410217 to your computer and use it in GitHub Desktop.
Convert directory of svn dumps to git repos
#!/bin/bash
# convert svn dumps located in ./svndumps/ into git repositories.
# assumes dump has basic svn top level structure of tags/, branches/, and trunk/,
# and authors.txt file of the svn committer id -> git committer id
# authors.txt example:
# csc = Christopher Corley <cscorley@ua.edu>
# inspired by/credit to: http://sebastian.formzoo.com/2010/11/04/3-steps-convert-svn-dump-to-git/
mkdir {svns, gits}
for repo in `ls ./svndumps/`; do
svnadmin create ./svns/${repo}
svnadmin load ./svns/${repo} < svndumps/${repo}
git svn clone file://${PWD}/svns/${repo} ./gits/${repo} --no-metadata -A authors.txt -t tags -b branches -T trunk
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment