Skip to content

Instantly share code, notes, and snippets.

@jurka
Created October 25, 2012 14:53
Show Gist options
  • Select an option

  • Save jurka/3953048 to your computer and use it in GitHub Desktop.

Select an option

Save jurka/3953048 to your computer and use it in GitHub Desktop.
svn 2 git migration
sudo apt-get install git-core git-svn ruby rubygems
sudo gem install svn2git
mkdir svn-repo
cd svn-repo
svn co [SVN URL] .
svn log -q | awk -F '|' '/^r/ {sub("^ ", "", $2); sub(" $", "", $2); print $2" = "$2" <"$2">"}' | sort -u > authors-transform.txt
# edit authors-transform.txt to this format:
# jsmith = J. Smith <[email protected]>
cd ..
mkdir git-repo
cd git-repo
svn2git [SVN URL] --authors ../svn-repo/authors-transform.txt
git remote add origin [GIT URL]
git push --all
git push --tags
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment