My Technical Notes

Wednesday, 18 March 2015

SVN - Branching and Merging

Branching

To work on a separate branch, we use `TortoiseSVN` → `Branch/tag...` on the trunk directory.

  • In the `To URL`, we specify the path to the branch directory, `.../branches/my_branch`.
  • Tick `Switch working copy to new branch/tag`.

At this point, our trunk is a working copy of `branches/my_branch`. We make all the changes we need to `my_branch` and check them in. Once we are satisfied, we have to merge the changes back into the trunk.

Merging

To merge the changes:

  • Switch working copy back to trunk. (SVN will remove all the changes you made, so the directory will look just like found on the SVN server.)
  • Now select `TortoiseSVN` → `Merge...`. Select `Reintegrate a branch`. In the `From URL`, we specify the full path to `branches/my_branch`. Click `Next` and then `Merge`. Once the merge is over, your trunk directory will look like your `my_branch` directory.
  • Finally, check-in all your changes as you would normally, to your trunk.

No comments: