#!/bin/sh reponame=$(git config svn-remote.svn.url|tr '/' '\n'|tail -n1) git for-each-ref refs/remotes/svn/tags | cut -d / -f 5- \ | while read oldref do ref=$(echo $oldref|sed -e "s/$reponame-*//") echo "Converting branch $oldref to tag ${ref}." git tag -a "$ref" -m"say farewell to SVN" \ "refs/remotes/svn/tags/$oldref" && \ git branch -r -d "svn/tags/$oldref" >/dev/null 2>&1 done