Created
October 29, 2010 10:35
-
-
Save timfel/653309 to your computer and use it in GitHub Desktop.
Simple script to convert svn subtrees to git from a git-svn repo (with all branches)
This file contains hidden or 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
function filter_git_repo () | |
{ | |
cd ../../GitRepos/$1; | |
git filter-branch --subdirectory-filter $1 -- --all; | |
cd ../../reporting_branch/cockpit/ | |
} | |
function push_git_repo () | |
{ | |
git push $1 --all | |
} | |
function add_git_repo () | |
{ | |
git remote add $1 ../../GitRepos/$1; | |
mkdir -p ../../GitRepos/$1; | |
cd ../../GitRepos/$1; | |
git init --bare; | |
cd ../../reporting_branch/cockpit/ | |
} | |
function convert_subdirectory_to_git_repo () | |
{ | |
add_git_repo $1 | |
push_git_repo $1 | |
filter_git_repo $1 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment