Skip to content

Instantly share code, notes, and snippets.

@ckorn
Created February 25, 2013 21:44
Show Gist options
  • Select an option

  • Save ckorn/5033621 to your computer and use it in GitHub Desktop.

Select an option

Save ckorn/5033621 to your computer and use it in GitHub Desktop.
These scripts convert remote tags/branches of git-svn into real git tags/branches: http://jausoft.com/blog/2009/07/08/svn-to-git-migration-1/
#! /bin/sh
branchfile=$1
shift
if [ -z "$branchfile" ] ; then
echo Usage $0 branchfile containing branchnames without ref path
exit 1
fi
for i in `cat $branchfile` ; do
git checkout --track -b $i remotes/$i
git checkout master
git branch -r -D $i
done
#! /bin/sh
tagfile=$1
shift
if [ -z "$tagfile" ] ; then
echo Usage $0 tagfile containing tagnames without ref path
exit 1
fi
for i in `cat $tagfile` ; do
git checkout --track -b tag_"$i" remotes/tags/$i
git tag $i tag_"$i"
git checkout master
git branch -D tag_"$i"
git branch -r -D tags/$i
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment