Is a TFS branch a physical or logical snapshot?

回眸只為那壹抹淺笑 提交于 2019-12-22 03:21:07

问题


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?


回答1:


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




回答2:


Short answer: Branches are stored logically and are not a direct copy of the parent.

Long answer: Bill Heys, a VS ALM Ranger, wrote a detailed blog post describing how branches and file history are stored in TFS.

http://blogs.msdn.com/b/billheys/archive/2011/05/05/how-tfs-stores-files-and-calculated-deltas-on-versioned-files.aspx



来源:https://stackoverflow.com/questions/537301/is-a-tfs-branch-a-physical-or-logical-snapshot

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!