Chapter 4. Branching and Merging

Table of Contents

What's a Branch?
Using Branches
Creating a Branch
Working with Your Branch
The Key Concepts Behind Branches
Copying Changes Between Branches
Copying Specific Changes
The Key Concept Behind Merging
Best Practices for Merging
Tracking Merges Manually
Previewing Merges
Merge Conflicts
Noticing or Ignoring Ancestry
Merges and Moves
Common Use-Cases
Merging a Whole Branch to Another
Undoing Changes
Resurrecting Deleted Items
Common Branching Patterns
Release Branches
Feature Branches
Traversing Branches
Creating a Simple Tag
Creating a Complex Tag
Branch Maintenance
Repository Layout
Data Lifetimes
Vendor branches
General Vendor Branch Management Procedure

君子务本 (It is upon the Trunk that a gentleman works.)


Branching, tagging, and merging are concepts common to almost all version control systems. If you're not familiar with these ideas, we provide a good introduction in this chapter. If you are familiar, then hopefully you'll find it interesting to see how Subversion implements these ideas.

Branching is a fundamental part of version control. If you're going to allow Subversion to manage your data, then this is a feature you'll eventually come to depend on. This chapter assumes that you're already familiar with Subversion's basic concepts (Chapter 1, Fundamental Concepts).