SVN joins trunk to branch

Assume the following.

I have two files A.cpp and B.cpp in trunk. In revision 50, I create an experimental branch called X. Therefore, in revision 50, both trunks and branch X are the same.

I continue to work with the torso and add C.cpp and D.cpp. Then I understand that there is an error in A.cpp and I am fixing the error.

Now my question is: how to send the updated A.cpp to the X branch without sending other files (B.cpp C.cpp D.cpp)?

+4
source share
3 answers

In the working copy of the branch, merge the revision that updated A.cpp. Alternatively, if you do not have changes in the local branch, you need to save, you can just svn copy A.cpp from the external line and overwrite the local A.cpp file.

Example

 cd workingCopyOfX svn merge -r50:51 http://my.repo.com/trunk/A.cpp 

assuming the fix was done in r51

+6
source

Depending on which platform you are on depends on how it is shown in the interface, but you just have to right-click on the file and choose to merge or deselect files that you do not want to merge in the interface.

If you are using a command line environment, you should simply run svn merge and enter a file name.

More details (although the old ones, I think, they are still relevant) can be found here

+2
source

There are probably many ways, but it’s easier for me to do it this way:

  • Go to the new (unmodified) working copy of the target (branch X)
  • Merge the entire version from the source (trunk) into your working copy.
  • Check local changes: discard unnecessary modified files, and possibly make some manual changes to the desired files.
  • When you are happy, commit
+1
source

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


All Articles