Created
April 5, 2012 08:02
-
-
Save aaronwalker/2308885 to your computer and use it in GitHub Desktop.
Migrate svn tags to git tags
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 | |
| GIT_REPO_NAME="MyNewGitRepo" | |
| SVN_REPO="http://SVN_REPO" | |
| #assuming your svn repo had the standard layout of /trunk, /tags and /branches. | |
| git svn clone -s $SVN_REPO $GIT_REPO_NAME | |
| cd $GIT_REPO_NAME | |
| for i in `git branch -r | grep tags` | |
| do | |
| tag=`echo $i | cut -d '/' -f 2` | |
| echo $tag | |
| git tag $tag tags/$tag | |
| #uncomment if you want to delete the branch | |
| #git branch -r -d tags/$tag | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment