Newbie branching and merging question

Apr 16, 2011 at 8:24 PM

Hello. Very quickly, I'll say that I am extremely new to branching and merging, but it is something that I believe could really help my organization out a lot. I've spent the last few days reading everything I could. Most of it makes sense to me. Some of it has not clicked *yet*.

I'm having trouble wrapping my head around a specific problem, and I'm hoping someone reading tihs can help. I've looked and looked for similar issues, but I haven't found anything that addresses my issue, and I'm really having a hard time figuring out keywords to search for to address it. So here it goes:

I have a very large Web site (thousands of files..aspx, vb, images, etc). We do a release of varying sizes at least once a week. Sometimes more. Sometimes the client calls us in the morning and says we need to do a release that day.

BACKGROUND: We have a team of 5-10 developers working on the same code base right now. Everyone checks everything into the same code base.

We have 1 TEST environment for our QA team to look at what's going to go live soon. When we're ready to deploy to TEST, we compile the code and we figre out which files are changed for that build and we deploy only those files to TEST. This way, if 2 developers are working on different parts of the site and checking in changes, we won't be putting changes for a later release on TEST. Sometimes 2 devlelopers are working on the same file for different releases, and it gets very confusing. This is where I think the branching can help us out.

I envision a scenario where basically our MAIN branch is really PRODUCTION. So basically every time we start work on a new release, we create a branch called "RELEASE 1", "RELEASE 2", etc...People working on release 1 will check files into the RELEASE 1 branch, etc...Then when we need to put a release on TEST, we do a build from that particular branch. Everything goes to the same TEST environment, but I can possibly change that if I need to. Then, when the release goes into prouction, we merge the release into the MAIN branch.

QUESTION: Here is my question. Let's say we have 2 releases going so there's a branch for RELEASE 1 and a branch for RELEASE 2. A developer for release 1 changes a global function in App_Code. Let's say that they add a new (required) parameter to a function. They update all of the files in their branch that use that function to pass in this new parameter. I understand that this will not affect the RELEASE 2 branch. But, let's say that the developer of RELEASE 2 adds some new code that uses the same function. They will add their code using the OLD parameter count. When we do a release 2 build, it will compile App_Code.dll with the OLD parameter count so all of the changes made for RELEASE 1 will be undone and probably things will break.

The only time the developer will actually know that this change was made is when we go to merge RELEASE 2 into MAIN which will be too late.

How can I get around this type of situation? Should I have like a BUILD branch which we merge into every time we do a build to TEST?


Thank you very much in advance for reading this and for your help. Any nudge in the right direction would be super appreciated.

Thank you.