Welcome to MSDN Blogs Sign in | Join | Help

More on branching and merging vs. sharing and pinning

Branching and merging in TFS provide a more robust way to accomplish what sharing and pinning are often used for in VSS.  In TFS, you would branch a directory (source), using the "branch source target" command, to the desired location (target).  Then when there are changes in the source that you need in the target, you would use the "merge source target" command to propagate the changes.  The merge command remembers what changes have have been brought over to the target, so it brings the target up to date with the source by only merging changes that have not been merged.

The merge command will pend edits, branches for files added, deletes, etc. in the target (in TFS, commands pend changes and then the checkin command submits all changes in a single atomic operation).  After running the merge, command you would then build the software and test it.  Additional changes may need to be made in the target, such as when you change a function or method signature.  When everything is ready, you would check in the merged changes, along with any other changes you needed to make, in a single atomic operation.

By doing this, you are able to build and verify before checkin each branch when it merges in the changes from the source.

There is no penalty in TFS with respect to having multiple branches of the same file.  In the SQL database, they all reference the same content.  Only when a branched file changes does new content get added.

With respect to merging binary files, there is nothing to do except run merge followed by checkin if the binary files in the target do not change.  If binary files in the target have changed, the merge command will produce conflicts for those files, and you would have to pick which to keep (source or target -- there is no 3-way content merge option, of course) when resolving the conflict.

If you want to have every project always use the same same file and immediately see new versions as soon as they are checked in, putting the file in a common location in the TFS repository, such as $/public/bin/dlls, is the way to go.  That does mean that everything that references it should use relative paths.  And since there is no isolation, everything that depends on the file must be checked prior to checkin, or you run the risk of silently breaking other projects (i.e., it requires manual coordination).

Published Monday, June 14, 2004 4:49 PM by buckh
Filed under:

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# Branching, Merging and Unit Testing

Monday, June 14, 2004 5:55 PM by Rob Caron's Blog

# Buck's posts on branching and merging

Tuesday, June 29, 2004 1:45 PM by Chris Rathjen

# Buck's posts on branching and merging

Thursday, July 01, 2004 3:37 PM by Chris Rathjen

# Branching and Merging in the Dec. CTP

Monday, January 24, 2005 9:09 AM by Buck Hodges

# No SourceSafe-style Sharing in VSTS - what do I do instead?

Last post, I wrote about the lack of sharing. The question I didn’t answer was, “Well, what should we...
Thursday, August 11, 2005 9:27 AM by Chris Rathjen

# No SourceSafe-style Sharing in VSTS - what do I do instead?

Last post, I wrote about the lack of sharing. The question I didn’t answer was, “Well, what should we...
Thursday, August 11, 2005 9:28 AM by Chris Rathjen

# No SourceSafe-style Sharing in VSTS - what do I do instead?

Last post, I wrote about the lack of sharing. The question I didn’t answer was, “Well, what should we...
Thursday, August 11, 2005 9:44 AM by Chris Rathjen

# A Brief SourceSafe User's Guide to Team Foundation Version Control

Moving from one software application to another often results in various "surprises" where the new application...
Friday, June 02, 2006 10:23 AM by Ed Hintz (MSFT)

# Team System & Team Foundation Links

General
If you only had time to read only one VSTS site, I suggest Rob Caron's: http://blogs.msdn.com/robcaron/...
Friday, July 07, 2006 2:09 PM by Sajee's WebLog

# Resources for Today's TFS Live Meeting

TEAM FOUNDATION SERVER Team System Overview http://msdn2.microsoft.com/en-gb/teamsystem/aa718836.aspx

Wednesday, February 28, 2007 3:39 AM by Microsoft UK Developer Tools Team

# Resources from VSTS Event 03/04/07

Wednesday, April 04, 2007 10:23 AM by Microsoft UK Developer Tools Team

# TechEd 2008 FAQ: Branching and Merging with Team Foundation Server

This was the most popular question asked at our booth (and perhaps all of the VSTS area) at Tech Ed Developers

Wednesday, June 18, 2008 3:57 PM by Chris Rathjen

Leave a Comment

(required) 
required 
(required) 

  
Enter Code Here: Required
 
Page view tracker