Work with Branches with Tortoise and Subversion

How to create branches, switch from branch to trunk and merging trunk to branch and branch to trunk without too many conflicts with Tortoise SVN

Create a branch with Tortoise

Commit everything

Select project folder -> Branch / Tag

To path -> /branches

Log message: enter description of your branch

Create copy in the repository from -> Head revision

Check: Switch working copy to new branch/tag

How to Switch from branch to trunk

Tortoise -> Switch -> To path: trunk

Commit changes

MERGE TRUNK TO BRANCH

It is important to keep up with changes going on in the trunk while you are working in the branch, so you will have the latest code version and won't have too many conflicts when you do the final merge from branch to trunk.

START THE MERGING WIZARD FROM WITHIN THE BRANCH

Tortoise > Merge > MERGE TYPE -> Merge a range of revisions

FROM: http://127.0.0.1/svn/my_project/trunk

Revision range to merge:

- All revisions

 

* THEN COMMIT ALL CHANGES TO THE BRANCH

 

MERGE BRANCH WITH TRUNK

This will be done only one final time when the development is finished on the branch and will be definitely merged with the trunk working version.

Commit all changes

 

SWITCH TO TRUNK

Tortoise > Merge > Merge a range of revisions

Url to merge from http://127.0.0.1/svn/my_project/branches/branch_name

Revision range to merge > check ALL revisions

NEXT >

 

Merge options > Merge depth > Select: WORKING COPY

Check: IGNORE ANCESTRY

Check: Ignore all whitespaces

 

- TEST IF EVERYTHING COMPILES

- Commit from trunk

 

[NOTE]: Check: IGNORE ANCESTRY --> This does not try to apply changes in a historical manner (maintaining changes in the trunk). It simply "applies the diff" between the trunk and the branch. This will not create any conflicts for your users in the files that were not modified. You will however lose your Historical information from the branch, but that happens when you perform a merge anyway.