Skip to content

Instantly share code, notes, and snippets.

@liyinsg
Created March 11, 2016 04:08
Show Gist options
  • Save liyinsg/2d6028847e84bbb89bca to your computer and use it in GitHub Desktop.
Save liyinsg/2d6028847e84bbb89bca to your computer and use it in GitHub Desktop.
Covert SVN to GIT
#!/bin/sh
branches=$(git branch -r | grep -v "origin/tags" | grep -v "trunk" | sed 's/origin\///')
for branch in $branches; do
git branch $branch refs/remotes/origin/$branch
done
tags=$(git branch -r | grep "origin/tags" | sed 's/origin\/tags\///')
for tag in $tags; do
git tag -a -m "tags from SVN" $tag refs/remotes/origin/tags/$tag
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment