
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
48
Chapter 4
CHAPTER 4
Branching and Merging
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 with them, 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 Subver-
sion to manage your data, 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 2).
What’s a Branch?
Suppose it’s your job to maintain a document for a division in your company, a
handbook of some sort. One day a different division asks you for the same hand-
book, but with a few parts “tweaked” for them, since they do things slightly differ-
ently.
What do you do in this situation? You do the obvious thing: you make a second copy
of your document, and begin maintaining the two copies separately. As each depart-
ment asks you to make small changes, you incorporate them into one copy or the
other.
You often want to make the same change to both copies. For example, if you dis-
cover a typo in the first copy, it’s very likely that the same typo exists in the second
copy. The two