#!/bin/sh set -x reponame=$(git config svn-remote.svn.url|tr '/' '\n'|tail -n1) #remotes/tags/release-0-7-8 git for-each-ref refs/remotes/origin/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/origin/tags/$oldref" && \ git branch -r -d "tags/$oldref" >/dev/null 2>&1 done