Skip to content

Instantly share code, notes, and snippets.

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 rip747/157560 to your computer and use it in GitHub Desktop.
Save rip747/157560 to your computer and use it in GitHub Desktop.
instructions for converting from svn to git
(no author) = Unknown Author <unknown@example.com>
tpetruzzi = Tony Petruzzi <tpetruzzi@gmail.com>
$ git svn clone --stdlayout --no-metadata --authors-file=authors.txt <svn_repo_url> <git_tmp_repo_dir>
$ cd <git_tmp_repo_dir>
$ git branch -r | sed -rne 's, *tags/([^@]+)$,\1,p' | while read tag; do echo "git tag $tag 'tags/${tag}^'; git branch -r -d tags/$tag"; done | sh
$ git branch -r | grep -v tags | sed -rne 's, *([^@]+)$,\1,p' | while read branch; do echo "git branch $branch $branch"; done | sh
$ cd ..
$ git clone --bare <git_tmp_repo_dir> <git_repo_dir>
$ cd <git_repo_dir>
$ git gc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment