tags:

views:

433

answers:

1

When code is branched in TFS using the branch method, is the code physically or logically branched? By logical, I mean is it just a changeset (changed deltas) or are all of the files copied?

+4  A: 

Branched files are not copied within the TFS database. A new version of the file will not be created until the branched version is modified. This is why creating a branch on a large project does not take forever.

Source:

http://www.codeplex.com/BranchingGuidance/Wiki/View.aspx?title=Isolation%20for%20Collaboration&referringTitle=Home

The fourth paragraph under branching explains that it does not create a separate copy of identical files:

Creating branches uses very little additional storage space. The server minimizes the storage required by only keeping one copy of identical content no matter how many different files are contained in the folder. So, if you have 100 copies of a 1 MB file and all of the files are identical, the server will store only 1 MB, not 100 MB. When you create a new branch and commit, all of the files in the new branch that are identical to the files in the source branch point to the same content. The result is that a branch consumes very little additional storage space, and that storage space expands only when the branched file becomes different than the source. And even when files change, Team Foundation Server employs a differencing engine to analyze changes between files and once again optimize storage space.

Microsoft Branching Guidance PDF:

http://geeks.netindonesia.net/downloads/etc/TFS-Branching.pdf

Jim Petkus
Excellent - that is exactly what I was looking for. Thanks!
j0rd4n
Downvote with no comment? This quote is directly from the Microsoft Branching guidance document and I have found it to be 100% accurate. We create branches on a very large project and the branches are created nearly instantly and take very little storage space.
Jim Petkus
Personal experience: with TFS making a branche would cost significant time while it is instantaneous now we have migrated to Subversion. I'm not sure about the inner workings, but TFS does more than a small administrative transaction.
Teun D
@Teun - I think it is fair to say branching in and of itself is not performed routinely (I've typically seen it done only when breaking off dot releases). My concern is with space more than time.
j0rd4n