11.07.2015 Views

Version Control with Subversion - Login

Version Control with Subversion - Login

Version Control with Subversion - Login

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Branching and MergingCheap Copies<strong>Subversion</strong>'s repository has a special design. When you copy a directory, you don'tneed to worry about the repository growing huge—<strong>Subversion</strong> doesn't actually duplicateany data. Instead, it creates a new directory entry that points to an existing tree. Ifyou're an experienced Unix user, you'll recognize this as the same concept behind ahard link. As further changes are made to files and directories beneath the copied directory,<strong>Subversion</strong> continues to employ this hard link concept where it can. It duplicatesdata only when it is necessary to disambiguate different versions of objects.This is why you'll often hear <strong>Subversion</strong> users talk about “cheap copies.” It doesn'tmatter how large the directory is—it takes a very tiny, constant amount of time andspace to make a copy of it. In fact, this feature is the basis of how commits work in<strong>Subversion</strong>: each revision is a “cheap copy” of the previous revision, <strong>with</strong> a few itemslazily changed <strong>with</strong>in. (To read more about this, visit <strong>Subversion</strong>'s web site and readabout the “bubble up” method in <strong>Subversion</strong>'s design documents.)Of course, these internal mechanics of copying and sharing data are hidden from theuser, who simply sees copies of trees. The main point here is that copies are cheap,both in time and in space. If you create a branch entirely <strong>with</strong>in the repository (by runningsvn copy URL1 URL2), it's a quick, constant-time operation. Make branchesas often as you want.Working <strong>with</strong> Your BranchNow that you've created a branch of the project, you can check out a new working copy tostart using it:88

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!