Kevon
Kevon

Reputation: 1297

How do I branch?

https://learn.microsoft.com/en-us/azure/devops/repos/tfvc/branching-strategies-with-tfvc?view=azure-devops

I have a brand new project in Azure DevOps. There's nothing in it yet, but I want to set up the branches to model the Servicing, Hotfix, Release isolation strategy from the link above.

To do this, I need a branch, and a branch of a branch.

When I right click my project and say "Branch", it prompts for a Target. This is where everything I try does not work.

First thing I tried was to use $/Master/HotFix. This returns an error "The target item $/Master/HotFix cannot be under the source item $/Master.

Then, I tried just $/Master-HotFix and get an error "Source control must branch into an existing team project. Master-HotFix is not a team project"

So, I went to Azure DevOps and I created a new project called Master-HotFix. I mapped it in Visual Studio, and tried again. This time, I got the error "Unsupported pending change attempted on team project folder $/Master-HotFix. Use the Project Creation Wizard in Team Explorer to create a project.

Surely making a branch isn't this difficult? What am I missing?

Upvotes: 3

Views: 2129

Answers (2)

Etienne
Etienne

Reputation: 1100

In order to branch in TFVC you first need to create you master/MAIN branch as a folder. Then you check that folder in. After you can convert it to a branch from the branch menu. After that you'll be able to branch off that master/MAIN branch and create the structure you are trying to do.

Cheers, ET

Upvotes: 0

PatrickLu-MSFT
PatrickLu-MSFT

Reputation: 51103

According to your description, seems you get promoted a kind of below dialog

TFS branch popup

I have a brand new project in Azure DevOps. There's nothing in it yet

You are trying to branch a Team Project rather than a folder containing your code.

You should first have your code in a folder, say "Master", under the "$/TeamProject/" folder. You can then branch "$/TeamProject/Master" to "$/TeamProject/Master/child".

If you have dumped all of your code into the root of your team project then you will need to move it into a folder first, then branch that folder.

warning: You can create a new team project that is a branch of this one, giving you "$/Master". However this method is a terrible idea and will lead to pain and suffering

For more details please refer our official tutorial:

  1. Convert a Folder to a Branch
  2. Branch a folder or file

Upvotes: 2

Related Questions