Last active
August 29, 2015 13:56
-
-
Save linse/9195473 to your computer and use it in GitHub Desktop.
SVN to Git, publish up to specific version
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
# http://www.sailmaker.co.uk/blog/2013/05/05/migrating-from-svn-to-git-preserving-branches-and-tags-3/ | |
# svn 2 git transformation, with prefix to avoid ambiguity and no metadata to avoid ugly commit messages | |
git svn -A ../MC-Fold/authors-transform.txt clone --prefix=svn/ --no-metadata -s http://svn.bioinfo.iric.ca/MC-Fold/ | |
cd MC-Fold/ | |
# transform svn branches into local git branches | |
git branch -r | |
for branch in `git branch -r | grep -v "svn/tags/" | sed 's/svn\///'`; do | |
git branch $branch refs/remotes/svn/$branch; | |
done | |
git branch | |
# transform svn tags into git tags | |
for tag in `git branch -r | grep "tags/" | sed 's/svn\/tags\///'`; do | |
git tag -a -m"Converting SVN tags" $tag refs/remotes/svn/tags/$tag; | |
done | |
git tag | |
# make the version 1.6, up to which we release, into the master | |
git checkout mcfold-1.6.x | |
git branch -f master mcfold-1.6.x | |
git checkout master | |
git log | |
# delete tags we don't release yet | |
git tag | |
git tag -d mcfold-autotools-2.0.0 | |
git tag -d mcfold-2.2.3 mcfold-2.2.2@417 mcfold-2.2.2 mcfold-2.2.1@405 mcfold-2.2.1 mcfold-2.2.0@400 mcfold-2.2.0 mcfold-2.1.1@390 mcfold-2.1.1 mcfold-2.1.0@376 mcfold-2.1.0 mcfold-2.0.3@340 mcfold-2.0.3 mcfold-2.0.2@336 mcfold-2.0.2 mcfold-2.0.1@326 mcfold-2.0.1 mcfold-2.0.0@276 mcfold-2.0.0 autotools-2.0.0 | |
git tag | |
# delete branches we don't release yet | |
git branch | |
git branch -d Cedric mcfold-2%2E%2E2.x mcfold-2%2E%2E2.x@435 mcfold-2.0.x mcfold-2.0.x@340 mcfold-2.1.x mcfold-2.1.x@389 mcfold-2.2.x mcfold-autotools-2.0.0 mcfold-autotools-2.0.x | |
git branch -D Cedric mcfold-2%2E%2E2.x mcfold-2%2E%2E2.x@435 mcfold-2.0.x mcfold-2.0.x@340 mcfold-2.1.x mcfold-2.1.x@389 mcfold-2.2.x mcfold-autotools-2.0.0 mcfold-autotools-2.0.x | |
git branch | |
# release it on github | |
git remote add origin git@github.com:major-lab/MC-Fold.git | |
git push -u origin master | |
# push branches | |
git branch | |
git push origin mcfold-1.5.x | |
git push origin mcfold-1.6.x | |
git push origin mcfold-autotools-1.6.x | |
git push origin cmake autotools | |
# push tags | |
git tag | |
git push --tags origin |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment