Skip to content

Instantly share code, notes, and snippets.

@andruby
Created March 15, 2013 11:28
Show Gist options
  • Save andruby/5169227 to your computer and use it in GitHub Desktop.
Save andruby/5169227 to your computer and use it in GitHub Desktop.
Shell script to import svn tags to git tags. Run this after git svn clone & git svn fetch. Remove line 6 if you don't want it to push the tag to origin.
git for-each-ref refs/remotes/tags | cut -d / -f 4- |
while read ref
do
echo "creating and pushing tag: $ref"
git tag -a "$ref" -m "import svn tag $ref" "refs/remotes/tags/$ref"
git push origin tag "$ref"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment