Solutions Log

Git Subtree Merge and git-svn

1 min read
howtogit-svnrecipe

Issue

Git submodules do not play nicely with git-svn; git subtree merging is a more appropriate strategy for my specific use case.

Resolution

This is my recipe (borrowed heavily from the formal git documentation).

git checkout -b TRY-MERGE master git remote add -f Bproject /path/to/B git merge -s ours --no-commit Bproject/master git read-tree --prefix=dir-B/ -u Bproject/master git commit -m "Task - JIRA-001 - Merge B project as our subdirectory" git checkout master git merge TRY-MERGE master -m "Task - JIRA-001 - Merging subtrees into project." git-svn dcommit

You may update your local copy from the remote at any time with:

git pull -s subtree Bproject master

Reference

http://kernel.org/pub/software/scm/git/docs/v1.7.0/howto/using-merge-subtree.html