Question

Our svn repository has lots of branches that are branches off of sub-trees. This works OK with svn because I can check out that sub-tree in the correct spot in my working copy. However, if I check out the same branch using git, I get a working copy with only the branch sub-tree. Is it possible to make git relocate the branch so that my working copy structure is identical whether I am on trunk or a branch?

I realize that our svn practices clash with git's philosophy of always working on the whole tree. How do people deal with this?

Was it helpful?

Solution

If possible, fix it on the server side: Subversion doesn't copy data when branching (svn copy), it just hardlinks, so there's really no obvious reason to branch out only a subtree.

If that's not feasible, you should have a look at http://help.github.com/subtree-merge/ -- it may do the trick, but I haven't tried it myself. He's basically describing an alternative to git submodules, where you just automatically merge the remote (in this case your Subversion branch) into a subdirectory instead of the root directory of the repository.

OTHER TIPS

I've never used svn like this, and if the silence you've gotten is any indication then it's kind of a rare practice. Could you give some rationale for doing things this way, maybe by describing what problem it solves? That way we can better judge what would be an acceptable solution.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top