Team foundation: the options of the merged target branch and how to migrate and change between team projects

Source: Internet
Author: User
Document directory
  • Let's simplify the scenario.
  • Does the final result of the two seem to be equivalent?
  • So how to migrate and change between independent team projects?

In rare cases, we often need to migrate changes between team projects. in the case of recommendation, the source code of all different versions of the same codebase or branch should be placed under the same team project, so as to facilitate the branch/merge operations of the source code, it also facilitates the association between work items and Code Change sets. however, certain company-specific policies may also be legacy policies, which often lead to poor practices in TFs. for example, to create separate team projects for source code of some specific versions, it is difficult for TFs to merge branch operations between team projects. Pay special attention to this.

Let's simplify the scenario.

The boss said to you, "we have an existing project sunpoject that stores our project code version 1.0. now the 1.0 project is nearing completion, and the 2.0 version is about to begin development. the company's source code management policy is to change the number of each major version, which requires a new team project. the source code of the new team project is provided by the current main branch of the previous main version. "," a, isn't it difficult? You just finished it ."

We have two ways to complete this task. When creating a new team project, there is an inconspicuous option that we may often ignore, however, this option directly determines the complexity of branch/merge operations in future work.

 

Operation 1: If you select "Create a New Source Control Branch" and select the source team project, the new team project will be created, the source code is automatically added to this new team project by branch.

Operation 2: If you select "Create an empty source control folder", an empty root directory will be created. then we can select the branch operation on the original team project to transfer the source code to this new team project.

 

Does the final result of the two seem to be equivalent?

Wait... It seems that things are not that simple...

The second scenario, after a while, the boss told you (the boss always said), ", we made a few hotfix on the 1.0 Team Project. "Are you sure you want to merge these hotfix into the 2.0 team project that we are developing now? "," Is a merge operation, isn't it difficult? "

So you open team explorer and select merge on Project 1.0. The difference is displayed at this time,

Symptom 1: If you selected step 1 in the previous step, you will see that there is a new team project in target branch. You can easily select the Changeset corresponding to hotfix and perform merge operations.

Symptom 2: If you selected step 2 in the previous step, you will see that there is no new Team Project in the selection list of target branch !!! When creating a new project, there is no corresponding branch relationship between the new and old projects!

So how to migrate and change between independent team projects?

The branch merge of TFS gives us two options: Command Line-based operations and UI-based operations.

Fortunately, we can use the command line-based TFs baseless merge command to complete this task.

TF merge/baseless-R "$/project2/main/source" "$/project1/main/source"

  • TF merge-Merge command of team Foundation
  • /Baseless-Indicates the baseless merge switch.
  • -R-Recursively merge subdirectories
  • "$/Project2/main/source"-Source Server Directory
  • "$/Project1/main/source"-Target Server Directory

In this way, you can perform merge. Unfortunately, due to the lack of the corresponding branch relationship between projects, every merge operation in the future can only be performed based on the command line...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.