SVN - how to apply changes made in the trunk to all branches

I start at SVN. I have an SVN directory structure like this:

|-trunk |-file1.php |-file2.php |-branches |-branch_1 |-file1.php |-file2.php |-branch_2 |-file1.php |-file2.php 

In the trunk, I have the main version of my application. I have two branches for different clients that have modifications in only some files. When I find the main mistake, I correct it in the trunk. For example, I changed the file1.php directory to trunk . I want to apply changes to files named file1.php in all branches.

I'm a little confused. In Version Control with Subversion, I found the following explanation.

The Subversion repository has a special design. When you copy a directory, you don’t need to worry about the storage growing huge - Subversion does not actually duplicate data. Instead, it creates a new directory that points to an existing tree.

So, although I am making changes to the trunk\file1.php , it will automatically be linked to other file1.php files, since I have not made any changes to these files in the branches directory.

How can I apply changes from the trunk directory to all branches? I tried to use svn merge as follows:

 svn merge -r 31:32 http://mysvnserver.com/project/branches/branch_1 

but I didn’t make any changes ( svn diff -r 31:32 returns all the changes I made.)

+7
merge svn
source share
3 answers

If you want to apply the change from the trunk to branch_1, the merge command needs to specify where to get the diff, and then specify the purpose for applying the merge to:

 cd branch_1 svn merge -r 31:32 http://mysvnserver.com/project/trunk . svn diff # confirm that the only diff is your change to file1.php svn commit 
+10
source share
 cd workingcopy svn merge -r 31:32 http://mysvnserver.com/project/trunk branches/branch_1 svn merge -r 31:32 http://mysvnserver.com/project/trunk branches/branch_2 svn commit -m "Merged r32 into branches" 
+2
source share

Try:

 svn merge -r 31:32 http://mysvnserver.com/project/trunk branch_1 

where branch_1 is your local branch working directory. That is, first you have the source address, and then the destination, which must be local.

0
source share

All Articles