Solutions Log by Dan Reiland

2Mar/100

Git Subtree Merge and git-svn

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

Comments (0) Trackbacks (0)

No comments yet.


Leave a comment

(required)

No trackbacks yet.