Created
March 11, 2016 04:08
-
-
Save liyinsg/2d6028847e84bbb89bca to your computer and use it in GitHub Desktop.
Covert SVN to GIT
This file contains hidden or 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
#!/bin/sh | |
branches=$(git branch -r | grep -v "origin/tags" | grep -v "trunk" | sed 's/origin\///') | |
for branch in $branches; do | |
git branch $branch refs/remotes/origin/$branch | |
done | |
tags=$(git branch -r | grep "origin/tags" | sed 's/origin\/tags\///') | |
for tag in $tags; do | |
git tag -a -m "tags from SVN" $tag refs/remotes/origin/tags/$tag | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment