Created
October 16, 2013 10:06
-
-
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>
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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