TFS Branching and Merging Beginners Question

Posted on 2013-01-17
Last Modified: 2013-02-05

We are using TFS and believe we need to use branching and merging.  We are 2 developers working on one website, we are in 2 geographical locations and are using to host our TFS.  We want to keep the main trunk as an exact replica of the production website.

Our plan is for every new sprint (monthly approx.) we will create a branch called “website-sprint001” etc.  We will work on the sprint in our separate locations and checkin our work to the branch periodically throughout the sprint (month) to in affect save the code so the other can see it.  When we are happy with the final code we will merge back the trunk and  release to the production website.  Is this the correct use of branching and merging?  Is there a better way to handle our situation?


Question by:nutnut
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
LVL 40

Expert Comment

ID: 38786943
>> Is there a better way to handle our situation?

Yes, don't use TFS, use Git. Not only was Git designed from the ground up to be a distributed SCM, it is also incredibly lightweight in terms of branching. In fact, the Git ethos is to branch for each and every change and only merge back to the main-line when a change is read.

The other thing with Git is both you and your colleague will have your own local copies of the repo so you have redundancy. It also means you can commit changes locally so you have a way to track and revert your local changes. You can both push to a "truth" repository when you are happy with your changes.

If you need more convincing, I'd recommend you watch this.

Author Comment

ID: 38786951
Thanks doesn't answer my question though
LVL 40

Expert Comment

ID: 38786957
Well, it does answer "Is there a better way to handle our situation?", which was one of the questions you asked :)
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now


Author Comment

ID: 38786970
Yes that is a good point it does, but we are commited to TFS and cannot change
LVL 40

Expert Comment

ID: 38786983
Understood and fair enough. Still, it's worth watching the youtube video when you have a moment, for no other reason that (a) it's hugely entertaining and (b) it'll make you re-think your world-view on how an SCM should work.

Other than what, I wish you good luck with your question.
LVL 40

Expert Comment

ID: 38787004
Oh, sorry - just one more thing I should have mentioned, there is a Git-TFS bridge that would give you the best of both worlds. In other words, you could use Git as a local and benefit from all that it offers as an SCM and you could push to your TFS server as the "truth" repo. This is something that a lot of people who are forced to use SVN do (git comes with an SVN bridge). Just something to consider.

This is probably also worth a look.
TFS Now Integrated with Git

Just thought I'd mention these in case you might find it worth something to look at.
LVL 22

Accepted Solution

ambience earned 500 total points
ID: 38787079
Well that is certainly one way to set it up but somehow I get a feeling that you are kind of over-protective of the trunk :)

Whether thats a good setup depends for example whether you are using TDD or otherwise have good test coverage. This allows you to keep adding to the trunk tested code. Continuous integration is even better.

Based on experience there are at least two problems that may arise

a) Some issues only come up when everything is brought together and everyone working in isolation necessitates further testing and bug-fixing after bringing it together.

b) I ran into this situation once when I branched code, did quite some refactoring and new stuff but then it was decided that only some of the stuff would go in the trunk. BUT ... it just wouldnt work because of the refactoring. I realized that it would have been better to merge the refactored code and then add new features. The solution was manually redo the stuff working on trunk (horrible).

Refactoring is the heart and soul of agile and the way I see, your suggested setup would only hinder it not make it any easier.

I would say that its probably better to branch after each release and have everyone work on the branch. When it reaches maturity tag it and move to another branch. If you need to release patches for previous branches then required code can be reverse merged.

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As more and more people are shifting to the latest .Net frameworks, the windows presentation framework is gaining importance by the day. Many people are now turning to WPF controls to provide a rich user experience. I have been using WPF controls fo…
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

628 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question