I am using SVN and my repository contains a trunk:
trunk
|
|_____A
|
|_____B
|
|_____C
I also have 2 branches with the same structure as the trunk:
branch
|
|_____DEV
|
|_____A
|
|_____B
|
|_____C
|
|_____PROD
|
|_____A
|
|_____B
|
|_____C
The trunk is used for ongoing development and the branches have the same structure as in the trunk but for different environments (i.e. DEV and PROD). I have a particular folder (folder 'A') common in both the trunk and the DEV branch which I would like to keep in synch i.e. any changes done in folder 'A' in the trunk are reflected automatically in the DEV branch in folder 'A'.
Which is the way to go? I have tried to build a post-commit script so that every change done in the trunk is committed to the branch automatically but till now I haven't succedded.
But why would you create the branch in this case? There are multiple problems which this approach.
Parallel development is not possible as in case as if team working on trunk commits something to solve some problem, it may break parallel development happening on branch1 or branch2. Consider the effort of stablizing branch1 or branch2 for what matters.
You will see many cases of conflict happening in trunk and branches.
Based on my experience working on multiple development project here is my recommendation. Hope this helps.
Keep a repository as parent and decide a merge plan on monthly basis (lets say). This will certainly have merge effort but stabilization effort would get decreased.
Another thing that can be done is to have a maven dependency in branch(s) which will use latest version released by parent repository. So copying whole repository while creating a branch can be avoided.