Created
October 24, 2017 00:05
-
-
Save DeeEighch/a8c2e694c513dc573d81ea8f2aa24f19 to your computer and use it in GitHub Desktop.
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
# download the svn dump'ed repo | |
wget https://storage.googleapis.com/google-code-archive-source/v2/code.google.com/spring-security-facelets-taglib/repo.svndump.gz | |
# unzip | |
gunzip repo.svndump.gz | |
# create the repo | |
svnadmin create /tmp/testgc | |
# restore it | |
svnadmin load /tmp/testgc/ < repo.svndump | |
# launch a local svn daemon | |
svnserve --foreground -d | |
# in another terminal, clone your repo now using git svn (optionally create a authors file for correctly mapping to git usernames) | |
git svn --stdlayout -A authors.txt clone svn://localhost/tmp/testgc/ | |
# go into the cloned repo | |
cd testgc/ | |
# add the upstream github repo | |
git remote add origin https://github.com/domdorn/spring-security-facelets-taglib.git | |
#push it | |
git push --set-upstream origin master | |
#till now, we only have the trunk / master branch | |
# get atlassians svn-migration-scripts.jar from https://bitbucket.org/atlassian/svn-migration-scripts/downloads | |
wget https://bitbucket.org/atlassian/svn-migration-scripts/downloads/svn-migration-scripts.jar | |
# run the scripts and expect the suggested actions | |
java -Dfile.encoding=utf-8 -jar svn-migration-scripts.jar clean-git | |
# if you like what you see (usually you do..), perform the actions | |
java -Dfile.encoding=utf-8 -jar svn-migration-scripts.jar clean-git --force | |
# after this i had a branch structure like this: | |
git branch -a | |
# * master | |
# remotes/origin/0.2_nate | |
# remotes/origin/0.4_gblaszczyk | |
# remotes/origin/jsf-1.2-spring-2 | |
# remotes/origin/jsf-1.2-spring-3 | |
# remotes/origin/jsf-2.0-spring-2 | |
# remotes/origin/jsf-2.0-spring-3 | |
# remotes/origin/master | |
# remotes/origin/site | |
# remotes/origin/site@17 | |
# remotes/origin/tags/0.1 | |
# remotes/origin/tags/0.3_jsf-1.2-spring-2 | |
# remotes/origin/tags/0.3_jsf-1.2-spring-3 | |
# remotes/origin/tags/0.3_jsf-2.0_spring-2 | |
# remotes/origin/tags/0.3_jsf-2.0_spring-3 | |
# remotes/origin/tags/0.5 | |
# remotes/origin/trunk | |
# checkout each branch (except tags and trunk) and push it | |
for i in `git branch -r | grep -v 'tags\|trunk' `; do git checkout ${i/origin\// }; git push; done | |
# push the branches | |
git push --all origin | |
# checkout each tag and create a tag with the same name | |
for i in `git branch -r | grep 'tags'`; do git checkout $i; git tag ${i/origin\/tags\// }; done | |
# push the tags git push --tags origin |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment