Branching and Merging (Team Explorer Everywhere)

When you develop applications in a team-based environment, you might need to access multiple versions of your application at the same time. If you copy one or more areas of your code into a separate branch, you can update one copy while you preserve the original version, or you can update both branches to meet different needs. Depending on your development goals, you can later merge the changes from multiple branches to create a single version that reflects all changes.

For example, you might encounter one of the following situations:

  • Different teams might work on sets of functionality within the same application. Each area might be reasonably discrete but depend on functionality that other teams build. You must first minimize the risk that one team’s changes will break another team’s functionality. After the code stabilizes, you must then merge the efforts of all teams into one product.

    When you isolate development work in separate branches, you enable the teams to develop their features in a stable environment before they merge changes.

  • Your testers must test a stable version of the code, but your developers must develop features that will occasionally destabilize the product.

    When you isolate development work in a separate branch, developers can not only implement features but also address bugs that the testers find. You might later merge those branches.

  • You might need to release minor updates of your application as your team develops the next major version.

    Your developers can fix bugs in a released version of your application in one branch and design and implement the next version of the application in another branch. Changes in one branch do not put the other branch at risk.

For practical guidance and strategies for branching and merging code in Visual Studio Team Foundation Server, see the following page on the Microsoft Web site: Microsoft Team Foundation Server Branching Guidance.

Common Tasks


Supporting Content

Create or update a branch: You can perform the following tasks:

  • Convert a folder in version control to a branch. This method is recommended for creating branches. Typically, you convert a folder to a branch, and then you can branch that branch as needed.

  • Create a branch from an existing branch.

    You might perform this task if, for example, multiple feature teams are working on the same application.

  • Create a branch from files or folders.

    This practice is not recommended.

  • Add files to a branch, or change the version of a file that is in a branch.

Merge branches: When you are ready to combine the changes from two branches, you must perform a merge operation. If a change in one branch conflicts with a change in another branch, you must resolve the conflict to complete the merge. You can resolve merge conflicts manually, or you can configure external tools to help resolve them.

See Also

Other Resources

Using Version Control (Team Explorer Everywhere)