Solved

TFS Branching and Merging Beginners Question

Posted on 2013-01-17
7
968 Views
Last Modified: 2013-02-05
Hi,

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 www.visualstudio.com 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?


Thanks

nutnut
0
Comment
Question by:nutnut
  • 4
  • 2
7 Comments
 
LVL 40

Expert Comment

by:evilrix
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.
0
 

Author Comment

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

Expert Comment

by:evilrix
ID: 38786957
Well, it does answer "Is there a better way to handle our situation?", which was one of the questions you asked :)
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

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

Expert Comment

by:evilrix
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.
0
 
LVL 40

Expert Comment

by:evilrix
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.
0
 
LVL 22

Accepted Solution

by:
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.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

With most software applications trying to cater to multiple user needs nowadays, the focus is to make them as configurable as possible. For e.g., when creating Silverlight applications which will connect to WCF services, the service end point usuall…
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

760 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now