1. Creating a repository, based on VisualSVN Server 3.5.0
(1) Right-click Repositories and select: Create new Repository…, then select: Regular FSFS repository, as shown in Figure 1

(2) Set Repository Name to: branch, as shown in Figure 2

(3) Select: Single-project repository(with the top-level ‘trunk’,’branches’ and ‘tags’ folders), as shown in Figure 3

(4) Select: Nobody has access, as shown in Figure 4

(5) Finish, as shown in Figure 5

(6) Right-click branch and select: Properties, as shown in Figure 6

(7) Select the user groups that need authorization: Develpoer and front_end_developer, as shown in Figure 7

(8) Set Permissions to: Read/Write, and click OK, as shown in Figure 8

2. Checking out the trunk
(1) Create a new directory named branch, as shown in Figure 9

(2) Navigate to the branch directory, right-click in the blank space, and select: SVN Checkout, as shown in Figure 10

(3) In the pop-up window, enter “https://192.168.2.63/svn/branch/trunk” in the repository URL field, leave the rest as default, and finally click OK, as shown in Figure 11

(4) Checkout complete, click OK, as shown in Figure 12

3. Committing to the trunk
(1) Navigate to the branch directory and create a new file named 1.txt, as shown in Figure 13

(2) Navigate to the branch directory, right-click in the blank space, and select: SVN Commit, as shown in Figure 14

(3) In the pop-up window, select all, add a log message, and click OK, as shown in Figure 15

(4) Commit complete, click OK
4. Creating branch v1
(1) Navigate to the branch directory, right-click in the blank space, and select “TortoiseSVN” -> “Branch/Tag” in sequence, as shown in Figure 16

(2) In the pop-up window, enter the branch address in the “To path” field. You can enter it manually or click the browse button on the right, as shown in Figure 17

(3) Click the browse button to open the pop-up window, as shown in Figure 18

(4) Select: branches, and click OK, as shown in Figure 19

(5) In the pop-up window, the branch address “/branches” has been automatically filled in the “To path” field, as shown in Figure 20

(6) Edit the branch address in the “To path” field to “/branches/v1”. Under “Copy from”, select “Repository” and choose “HEAD revision in the repository”. Add a log message and click OK, as shown in Figure 21

(7) Branch creation complete, as shown in Figure 22

5. Switching to branch v1
(1) Navigate to the branch directory, right-click in the blank space, and select “TortoiseSVN” -> “Switch” in sequence, as shown in Figure 23

(2) In the pop-up window, enter the branch address in the “To path” field. You can enter it manually, select it from the drop-down list, or click the browse button on the right. Click OK, as shown in Figure 24

(3) Switch complete, as shown in Figure 25

6. Committing a new file on branch v1
(1) Navigate to the branch directory (working copy) and create a new file named v1.txt, as shown in Figure 26

(2) Right-click in the blank space, select: SVN Commit, select all, and add a log message, as shown in Figure 27

7. Switching to the trunk
(1) Navigate to the branch directory, right-click in the blank space, and select “TortoiseSVN” -> “Switch” in sequence, as shown in Figure 28

(2) In the pop-up window, enter the branch address in the “To path” field. You can enter it manually, select it from the drop-down list, or click the browse button on the right. Click OK, as shown in Figure 29

(3) Switch complete, as shown in Figure 30

8. Committing a modification to the trunk (Note: The trunk is used for fixing bugs, not for adding new features. It is recommended to use it only for merging branches)
(1) Navigate to the branch directory and edit the file 1.txt, as shown in Figure 31

(2) Right-click in the blank space, select: SVN Commit, select all, and add a log message, as shown in Figure 32

(3) Commit complete, as shown in Figure 33

9. Switching back to branch v1
(1) Navigate to the branch directory, right-click in the blank space, and select “TortoiseSVN” -> “Switch” in sequence, as shown in Figure 34

(2) In the pop-up window, enter the branch address in the “To path” field. You can enter it manually, select it from the drop-down list, or click the browse button on the right. Click OK, as shown in Figure 35

(3) Switch complete, as shown in Figure 36

(4) At this point, opening 1.txt reveals that the operations performed in step 8 have been reverted, because they were committed to the trunk, not to branch v1, as shown in Figure 37

10. Committing a modification on branch v1
(1) Navigate to the branch directory and edit the file 1.txt, as shown in Figure 38

(2) Right-click in the blank space, select: SVN Commit, select all, and add a log message, as shown in Figure 39

(3) Commit complete, as shown in Figure 40

11. Merging the trunk into branch v1
(1) Navigate to the branch directory, right-click in the blank space, and select “TortoiseSVN” -> “Merge” in sequence, as shown in Figure 41

(2) In the pop-up window, under Merge type, select: Merge a range of revisions, and click Next, as shown in Figure 42

(3) In the merge window, for the URL to merge from, you can enter it manually, select it from the drop-down list, or click the browse button on the right. Click OK, as shown in Figure 43

(4) Click the browse button to open the pop-up window, select: trunk, and click OK, as shown in Figure 44

(5) At this point, the merge source has automatically changed to “https://192.168.2.63/svn/branch/trunk”, as shown in Figure 45

(6) For the revision range to merge, select: specific range (if you do not specify a revision range, all unmerged revisions will be selected), as shown in Figure 46

(7) For merge options, just keep the default settings here, as shown in Figure 47

(8) Before clicking the Merge button, you can test the merge first to check whether it succeeds and view the merge details, as shown in Figure 48

(9) The resolve conflicts window pops up, as shown in Figure 49

(10) Remaining conflicts: Resolve all later, as shown in Figure 50

(11) The modifications made to the trunk will be synchronized into branch v1, and the automatic merge is complete, as shown in Figure 51

(12) Open 1.txt, as shown in Figure 52

(13) Manually resolve the conflicts by editing 1.txt and deleting the 3 conflict files starting with 1.txt., as shown in Figure 53

12. Committing the merged branch v1
(1) Commit, as shown in Figure 54

(2) Commit complete. At this point, branch v1 is fully synchronized with the trunk. If development on branch v1 is finished, you can merge branch v1 back into the trunk. Of course, if development on branch v1 needs to continue, you will repeatedly perform steps 10-11, as shown in Figure 55

13. Merging branch v1 into the trunk (Prerequisite: Development on branch v1 is finished)
(1) First, switch to the trunk; you can refer to step 7, as shown in Figure 56

(2) Navigate to the branch directory, right-click in the blank space, and select “TortoiseSVN” -> “Merge” in sequence, as shown in Figure 57

(2) In the pop-up window, under Merge type, select: Merge a range of revisions, and click Next, as shown in Figure 58

(3) In the merge window, for the URL to merge from, you can enter it manually, select it from the drop-down list, or click the browse button on the right. Click OK, as shown in Figure 59

(4) Click the browse button to open the pop-up window, select: branches/v1, and click OK, as shown in Figure 60

(5) At this point, the merge source has automatically changed to “https://192.168.2.63/svn/branch/branches/v1”, as shown in Figure 61

(6) For the revision range to merge, select: specific range (if you do not specify a revision range, all unmerged revisions will be selected), as shown in Figure 62

(7) For merge options, just keep the default settings here, as shown in Figure 63

(8) Before clicking the Merge button, you can test the merge first to check whether it succeeds and view the merge details, as shown in Figure 64

(9) Automatic merge complete, as shown in Figure 65

(10) View the contents of 1.txt; the modifications made in branch v1 will be synchronized into the trunk, as shown in Figure 66

14. Committing the merged trunk
(1) Right-click in the blank space, select: SVN Commit, select all, and add a log message, as shown in Figure 67

15. Showing the log
(1) Display the log messages. If you check “Include merged revisions”, you can view merge-related information, as shown in Figure 68

16. It is recommended to adjust steps 13-15 to 16-18 to merge branch v5 into the trunk (Prerequisite: Development on branch v5 is finished)
(1) First, switch to the trunk; you can refer to step 7
(2) Navigate to the branch directory, right-click in the blank space, and select “TortoiseSVN” -> “Merge” in sequence, as shown in Figure 70

(3) In the pop-up window, under Merge type, select: Merge two different trees, and click Next, as shown in Figure 71

(4) In the merge window, enter the full folder address of the trunk in the From: field, as shown in Figure 72

(5) In the To: field, enter the path of branch v4. You can click the browse button on the right to select it. Click OK, as shown in Figure 73

(6) At this point, the To: field has automatically changed to “https://192.168.2.63/svn/branch/branches/v5”, as shown in Figure 74

(7) At the “Revision to” field, click the “Show Log” button next to the revision to view the starting revision of branch v5, which is: 26, as shown in Figure 75

(8) At the “Revision from” field, select the revision, click the “Show Log” button next to the revision, and select revision: 25, which is the revision immediately preceding the starting revision 26 of branch v5 to be added, as shown in Figure 76

(9) In the merge window, the final options are as shown in Figure 77. Click Next

(10) Before clicking the Merge button, you can test the merge first to check whether it succeeds and view the merge details, as shown in Figure 78

(11) Automatic merge complete, as shown in Figure 79

17. Committing the merged trunk
(1) Right-click in the blank space, select: SVN Commit, select all, and add a log message, as shown in Figure 80

18. Showing the log
(1) Display the log messages. If you check “Include merged revisions”, you can view merge-related information, as shown in Figure 81

19. Summary:
(1) Branches are primarily used for developing new features
(2) Merging occurs in the local working copy; as long as you do not commit, it will not affect the repository
(3) Before merging, you must perform an update and commit first to save your local modifications to the repository
(4) During parallel development between the branch and the trunk (merging other branches into the trunk), you should synchronize frequently by merging the trunk’s modifications into the branch, selecting “specific range” when merging
(5) Only after development on the branch is finished can you merge the branch into the trunk
