Created
October 31, 2016 12:29
-
-
Save cmandersen/8dbe4a3cad163228999611d2bf4ed77a to your computer and use it in GitHub Desktop.
Convert an SVN project to Git
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# `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 <[email protected]> | |
# 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