Under Eclipse, SVN creates branches, merges branches, and switches branches

1. Create a branch

Right-click on the project name, pop up the menu, select "Team", and then select "Branch/Tag", the following page will pop up: 

The "Copy to URL" in the above figure fills in the path address for creating a new branch, and the program will be copied to this directory later to form a new branch. Click "Next":

Select the latest version and click "Next"

If you check the switch working copy to new branch/tag below the figure above, the eclipse program project will automatically switch to the branch. We do not choose here, we will switch by ourselves later.

This creates a 1.0 branch

2. Toggle

You can merge from the trunk to the branch, or from the branch to the trunk. You can choose the appropriate option according to your needs, as shown below:

Options in the image above:

        1) Merge from trunk to branch

        2) Merge from branch to trunk

        3) Merge changes on trunk to branch

        4) Merge 2 branches to trunk

        5) From trunk to branch, manually specify changes that do not need to be merged

        6) From the trunk to the branch, manually specify the changes to be merged

What I'm using: Merge 2 branches to trunk

The above picture shows that there is no modification, so there is no need to merge. If modification is made, select "Next", and the following picture will appear.

The above picture is the most critical step: I think that merging is actually overwriting the content of one branch onto another branch.

As shown in the figure, 106 and 107 are both branches based on 1.1.1. The version number of 106 is 130, and the version number of 107 is 131.

After the developer commits, the version number of 106 becomes 266, and the version number of 107 becomes 302. Now we want to put the 106 branch

Overwrite to 107, but if 107 is also modified, it needs to be preserved and cannot be overwritten, and the same file needs to be manually resolved.

We need to put 107 in the address bar above, then select the original version number 131 (should show 132), no nonsense.

3. Toggle

Right click on the project name and select "Team" -> "switch to another Branch/Tag/Revision".

Select the destination address to be switched and click OK.

 

In this way, in the project, you can switch between the trunk and several branches arbitrarily to realize the modification and submission of programs of different versions/branchs.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324405040&siteId=291194637