Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it valid in subversion to branch a subfolder?

Tags:

svn

I have a subversion project that have a repository and trunk, tags, branches top-level items. For this project, trunk contains a folders for a big parts like 'common', 'libs', 'core', 'help', 'install', 'tests' etc. The question: is it valid in subversion to branch trunk/common or do i need to always branch entire trunk?

I have checked - all seems work fine while branching trunk/common, but TortoiseSVN don't show such branches in revision graph :(. This leads me to the assumption that it is not correct to branch something over than trunk.

like image 860
grigoryvp Avatar asked Oct 26 '10 14:10

grigoryvp


People also ask

How does subversion handle branch changes?

Remember that Subversion merges changes into your working copy first, and then you commit them back to the repository. So Subversion will apply your branch changes to your working copy of trunk, and then you commit those changes to trunk.

How do I change the working copy of a Subversion repository?

Using the svn switch command you can have Subversion modify your working copy to reflect another directory in the repository. Switching may not sound that exciting but it’s key to branching and merging, as you’ll soon see. First off, ensure that your working copy has no local changes. Either commit your changes or revert them.

How do I reintegrate two branches in SVN?

Before you reintegrate, ensure the two branches you will be using are in a clean state (have no uncommitted changes.) In command line enter the directory of the branch that you want to reintegrate your work in to (usually trunk) and run svn update.

How do I merge changes from trunk to branch?

Develop in your branch, periodically merging the latest changes from trunk into your branch When your development is complete, merge changes from your branch back into trunk Your local working copy reflects some directory in the remote Subversion repository. If you initially checkout trunk, then your working copy reflects trunk.


1 Answers

You can branch every directory in SVN but it's a best practice to branch from trunk. The result in tortoise is cause TortoiseSVN assumes branches are made from trunk folder instead of subfolders. The questions is why do you try that an what advantages do you expect from "branching " a sub-folder instead of trunk?

like image 96
khmarbaise Avatar answered Nov 15 '22 20:11

khmarbaise