Created
September 12, 2011 17:58
-
-
Save benstiglitz/1211929 to your computer and use it in GitHub Desktop.
Pulling one repository into a subtree of another and pushing to SVN.
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
git remote add -f tp file:///Volumes/Sources/tp.git/ | |
INITIAL_COMMIT=`git rev-list tp/master --reverse | head -n1` | |
git checkout -b nb-merge | |
for MCH in `git rev-list --reverse $INITIAL_COMMIT..tp/master` | |
do | |
git merge --squash -s subtree --no-commit $MCH && git commit -C $MCH | |
done | |
git filter-branch --msg-filter "sed 's/^/[new-branch] /'" master..HEAD | |
git svn branch new-branch -m "[new-branch] Creating branch." | |
git rebase refs/remotes/new-branch | |
git svn dcommit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment