Search code examples
tfsazure-devopsbranching-and-mergingtfvc

ASP.NET MVC TFS Branching


I've read several posts about branch and merge feature of SVC and creating branches in TFS, following those steps I've created branch for a breaking change in a feature of ASP.NET MVC application, After successful creation of branch, branched files (new files) excluded from application, attempting to include files in project will create duplicate signature errors. so I've to carryout changes in original files (files available before branching) now I don't know actual purpose of branches.

If I need to work with existing files why do I need to create branch?

How to setup and configure branching operation in TFS Version Control?

How really it helps?

Edit:

Attached image I've created a branch @ controller folder (Source Control Explorer), After successful creation of Branch I found two directory in One Controller another Controller-Branch (which is excluded from project by default). Now in what set of files I need to work?

When I Work in "Controllers" file set, these changes push back to other developers and so I don't see any isolation of environment there.

If I need to work in "Controllers-branch" why it is excluded from project? when I attempt to Include "Controllers-branch" to project, code definitions, class names duplicated (i.e., these definitions conflicts with contents of "Controllers" folder)


Solution

  • Why there have two branches Controllers and Controllers-branch:

    It’s because when you created a branch (branching and merging -> branch) based on Controllers folder, you also select Immediately convert source folder to branch (enables visualizations), this will convert Controllers folder to branch.

    enter image description here

    So based on your need, you should convert Controllers branch into folder (right click Controllers branch -> branching and merging -> convert to folder).

    Why Controllers-branch is isolate from your project:

    It’s because Controllers-branch is a branch, and the TFVC branch can achieve these goals:

    • Manage concurrent work by multiple teams on the same codebase

    • Isolate risks that are introduced by different sets of changes to the codebase

    • Take snapshots and then support subsequent isolated changes (for example, to create a release branch)

    So it should be works isolated. If your work own is not only updated files in Controllers folder, but also need to modify files for the whole project, you should create a branch from ApplicationMain folder a,d make sure Immediately convert source folder to branch (enables visualizations) is not selected. Then you can work on ApplicationMain-branch concurrently from other developers.

    enter image description here