Skip to content

Instantly share code, notes, and snippets.

@cmandersen
Created October 31, 2016 12:29
Show Gist options
  • Save cmandersen/8dbe4a3cad163228999611d2bf4ed77a to your computer and use it in GitHub Desktop.
Save cmandersen/8dbe4a3cad163228999611d2bf4ed77a to your computer and use it in GitHub Desktop.
Convert an SVN project to Git
# `cd` into the svn directory
svn log -q | awk -F '|' '/^r/ {sub("^ ", "", $2); sub(" $", "", $2); print $2" = "$2" <"$2">"}' | sort -u > authors.txt
# translate the svn usernames
# cma = cma <cma>
# into this:
# cma = Christian Morgan Andersen <christian@cmandersen.com>
# create a directory for the git project
# move the authors.txt into the new directory
# `cd` into the new directory
git svn clone [SVN repo URL] --no-metadata -A authors.txt --stdlayout ./
# push the new git project to the new git repo on the server
# Enjoy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment