Skip to content

Instantly share code, notes, and snippets.

@padawin
Created October 16, 2013 10:06
Show Gist options
  • Save padawin/7005522 to your computer and use it in GitHub Desktop.
Save padawin/7005522 to your computer and use it in GitHub Desktop.
script to checkout a branch in git from a svn repository, with git-svn. Usage: copy this file in your /usr/local/bin/ folder, and call git svnbranch <yourbranch> to checkout a branch. The local branch will be called local-<branchname>
#!/bin/sh
[ -z $1 ] && exit 1
git config --add svn-remote.$1.url svn+ssh://svnrepohost/path/to/branches/$1
git config --add svn-remote.$1.fetch :refs/remotes/$1
git svn fetch $1
git checkout -b local-$1 -t $1
git svn rebase $1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment