Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the consequences of creating a branch from a subfolder of trunk in SVN?

Tags:

branch

svn

I thought that normally when you branch, you branch the whole trunk, but in my company I've seen people branch subfolders of trunk and deeper- are there any practical consequences of this besides confusion when you try to find the right directory in the trunk to merge back into?

like image 403
fordeka Avatar asked Apr 20 '13 05:04

fordeka


People also ask

What happens when a branch is created in Subversion?

Subversion Branching Strategies Subversion branches (SVN branches) allow your team to work on multiple versions of your code simultaneously. Developers can test out new features without impacting the rest of development with errors and bugs. SVN's “branch” directory runs parallel to the “trunk” directory.

Can we create branch in svn?

To create a branch or a tag in a Subversion repository, do the following: From the main menu, choose VCS | Subversion | Branch or Tag. Alternatively, select the source folder in the SVN Repositories tool window and choose the Branch or Tag command from the context menu.

How do I merge svn changes from one branch to another?

You can merge specific changesets from one branch to another by naming them in the merge arguments: passing -c 9238 to svn merge would merge changeset r9238 into your working copy.


1 Answers

The problem is not the branching.. it is the merging:

Never merge back into such a "subtree" folder. Why? Subversion will store its merge-info into this subtree folder. And as soon as this happens, nobody can use merge -reintegrate anymore.

Look here for more information:

Avoid subtree merges and subtree mergeinfo, perform merges only on the root of your branches, not on subdirectories or files

This means as long as you have subtree merge-infos hanging around in your trunk you can not use the -reintegrate option, which you usually should use, because in this way merging is much much easier.

like image 112
Peter Parker Avatar answered Nov 07 '22 19:11

Peter Parker