How to avoid SVN conflicts when merging a branch back to the trunk

A few weeks ago, I started making changes to my SVN repository, which I thought would be pretty minor.

After several hours of work, realizing that the change is more important than I thought, I decided it was too risky to check my changes in the trunk immediately, so I made a branch, for example:

svn copy . https://my_svn_server/svn/blah/branches/my-branch

... and then switched to the svn switch and gladly continued to work in this thread. So far, so good, until I get to the point that I'm happy with all the changes and want to merge them back into the trunk again. Therefore, I check all the changes in my branch, and then carefully follow the procedure given here ... and this is where I encountered the trouble. Since I created my branch from the local (client) repository, which already had a large number of (unverified) changes that are outstanding in it, the merge does not include the differences corresponding to these changes, and therefore there are many, many conflicts in the merge, which I have to solve manually - something I don’t want to do, as it leaves room for errors to fill in if I ruin it.

I tried to include the missing differences by decreasing the revision number that I specify during the merge, for example. by doing

svn merge -r2818:2932 https://my_svn_server/svn/blah/branches/my-branch

instead of the expected

svn merge -r2819:2932 https://my_svn_server/svn/blah/branches/my-branch

... but this did not work because my-branch did not exist in edition 2818, and therefore I just get the error message:

svn: Unable to find repository location for 'https://my_svn_server/svn/blah/branches/my-branch' in revision 2818

So, about where things are. This time I can manually deal with the mess, but I'm curious if there is a way to handle this so that next time things get better for me.

, , - , () , SVN- HEAD, , ( ) my-branch, ... .

, , , ( ) , ?

+3
2

. , HEAD.

svn switch https://my_svn_server/svn/blah/branches/my-branch

, . , .

+7

, , , (, , ?). , : ( ) , , :

svn merge https://my_svn_server/svn/blah/trunk/software@2818 https://my_svn_server/svnblah/branches/my-branch@2819
svn merge -r2819:2932 https://my_svn_server/svn/blah/branches/my-branch
+1

Source: https://habr.com/ru/post/1715034/


All Articles