Skip to content

Instantly share code, notes, and snippets.

@aaronwalker
Created April 5, 2012 08:02
Show Gist options
  • Select an option

  • Save aaronwalker/2308885 to your computer and use it in GitHub Desktop.

Select an option

Save aaronwalker/2308885 to your computer and use it in GitHub Desktop.
Migrate svn tags to git tags
#!/bin/sh
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
#!/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