crichavin
crichavin

Reputation: 4582

How to merge source code using TFS in VS 2012

I have the source code 3.50 version of NopCommerce under source control using TFS. I have had to make some core changes to the code to accommodate a client need. Now I'd like to take advantage of some new code in version 3.70 of NopCommerce. I am not a TFS or source control expert so I am not sure how to approach this.

My initial thoughts:

  1. Convert my current base code repository to a Branch called 3.50.
  2. Create a new branch called 3.70 and load up the new source code into it.
  3. Merge 3.50 into 3.70 and work through code conflicts.

Is this correct?

Upvotes: 2

Views: 177

Answers (1)

GregHNZ
GregHNZ

Reputation: 8989

I'd suggest you reword step 3.

Or perhaps re-appraise your strategy. I doubt that a "merge and then address conflicts" process would be simple or successful for any meaningful changes that you have made.

Critically, rather than "Merge 3.50 into 3.70" I'd be thinking more "Identify the changes made to the 3.50 code and recreate them in the 3.70 code"

There are two basic strategies you could follow:

1) look at the TFS log of modifications that you made to 3.50, understand each one, and re-do that change against the 3.70, one at a time.

2) Figure out the overall current difference between your code and the 3.50 code you started from. Then re-create those changes in the 3.70 code. I'd do this by getting fresh copy of 3.50 (either download it again, or out of the history in your TFS server) somewhere else, and do a tree diff between the raw 3.50 code and your current copy. WinMerge works real well for this sort of thing.

Which one is going to work best will depend on the complexity of the changes you've made to the code, how many steps they were made in, and the quality of the documentation (requirements, design, code comments, commit comments, etc) created during the process.

So in terms of branching, I'd do 1 and 2 as you outlined, but the merge would be a careful, manual approach, into, as you say, the 3.70 branch.

Upvotes: 1

Related Questions