Improve company productivity with a Business Account.Sign Up


TFS Branching and Merging Beginners Question

Posted on 2013-01-17
Medium Priority
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
  • 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 :)
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.


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 23

Accepted Solution

ambience earned 2000 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
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.

605 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