Branching

My new project uses branching in TFS. Every project to improve the product is done on a branch. This is correct use of TFS, since it is a Application Lifecycle Management tool. In this post I’ll describe how I merged back to the Main branch and created a new branch for the next project on the same product.

The source explorer shows 4 branches. One branch is the mother of the other branches, this is called Main. The other branches are named after the project. To see the hierarchy in Source Explorer select a branch and choose View Hierarchy in the context menu.
branch_view_hierarchy

In the hierarchy view you can compare two branches by selecting both. Then choose Compare in the context menu. You’ll get a dialog with the source and target for the compare set to the branches.
branch_compare_branches

Together with the history of both branches I noticed some potential issues.

  1. A file was added to Main after the branch was made. How will the merge process handle this?
  2. A file was edited in both branches after the branch was made. Which is the correct version?

I consulted the persons who performed the checkins. We looked into the files and decided what the result of the merge should be. During the merge process (select the branch to merge to Main) TFS had one conflict it could not resolve. This was the extra file (1) in the list of potential issues above. With merge changes in merge tool I included both changes into the project file. The rest was auto resolved and a clean build showed no issues. To make it really sure I checked the edited file (2) from the list of potential issues above. It was handled correctly.

After the merge process I made a new branch. TFS notified me that this is an administration only and couldn’t be rolled back. I clicked Yes.
branch_warning

Prepare for the worst and hope for the best
Benjamin Disraeli

TFS did most of the heavy lifting. My work was limited to one manual merge and a clean build. Now I’m ready to start the project with a shinny new branch.

About erictummers

My work as a recruited developer changes almost every month. I like challenges and sharing the solutions with others. On my blog I’ll mostly post about my work, but expect an occasional home project, productivity tip and tooling review.
This entry was posted in Tooling and tagged , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s