TFS - Branching - tfs

I am doing to for the first time so I want to use Release isolation strategy for our project using TFVC. I went over documentation on how to do that but I was unable to branch out our projects. We have two projects which are dependent on each other and structure of those projects looks like this:
Project 1
folder 1
folder 2
folder 3
I tried to convert project itself to branch and then branching it out but it gives me an error saying TF10175: ... Team project does not exist. Then I tried to create one main folder inside the project and convert that folder into branch and then branch it out but reorganizing folders causing build issues. Do you have any advice how I could branch my projects out and why am I getting team project does not exist issue. Do I need to create new project in TFS called XYZ-branch?

Related

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?
According to your description, seems you get promoted a kind of below dialog
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:
Convert a Folder to a Branch
Branch a folder or file
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

Correct procedure for branching this TFS Team Project

On our TFS Server, we have a Team Project called "Connect". The root folder for that Team Project contains the root of the web application project. I'm not sure if it was setup correctly, but what I'm trying to do is create a branch of the "Connect" Team project so there are 2 versions, 1 for Production, 1 for a new development/enhancement. What are the correct steps to get the right structure? So that we can work on the enhancement in one, and eventually merge it into the production branch....
You'll have to do some restructuring here. At a minimum that is probably:
$/Connect
---------dev
---------main
Where dev and main will become your branches and contain all the code that is currently in the root.
I'd usually expect to see something more like
$/Connect
---------ConnectWeb
-------------------dev
-----------------------src
--------------------------Connect
-------------------main
-----------------------src
--------------------------Connect
where dev and main are the branches and Connect contains the files and folders currently in root. By putting the branches in another folder (I called it ConnectWeb) you have the option of having multiple development projects within the same Team Project which allows you to manage a portfolio backlog in a single team project.
Rename or move files and folders

TFS Create Main and Development branch from existing team project

Currently we have a team project in TFS 2010 named MyApp that was put in years ago. I would like to create MAIN and DEV branches as described in the ALM Rangers guide. I know it would've been easier if the existing team project was created with the branches initially, but that's in the past. I don't want to lose the version history in the existing project.
Is it possible to create those branches (or at least a DEV branch) without affecting the existing project?
UPDATE My folder structure looks something like this (bold is folder, italic is file):
server\DefaultCollection
MyApp
Lib
packages
Repositories
MVCClient
MyApp.sln
There's not a great solution to this, but here's one option:
Create a MAIN folder. Copy all your source under this folder. Convert MAIN to a branch. Branch DEV from MAIN.
Keep your old source code around (the stuff not under the MAIN folder) for history purposes.

TFS 2010 Working Folders Setup in a Build

I have a folder structure setup for my code like so:
MyCodeFolder
-SolutionFileOne.sln
-ProjectFolder1
-ProjectFolder2
-ProjectFolder3
-SolutionFileTwo.sln
-ProjectFolderA
-ProjectFolderB
-ProjectFolderC
-ProjectFolderCommon
Solution one contains projects 1,2,3 and Common and Solution two contains project A, B ,C and Common.
When I come to create my TFS Builds I am getting a problem. If I just add MyCodeFolder in the working folder set up then both builds will succeed but then check-ins against project 2 will kick off a build of solution two and vice versa.
If I map only the folders the solution needs the build fails, which I am guessing is down to the fact I haven't included a mapping to the folder where the solution file is (the MyCodeFolder).
Is there a way I can solve this issue without altering my file structure?
The continuous integration trigger in TFS builds will queue a new build any time an item within that build's workspace is altered. Workspace mappings can only contain folders - you cannot include \ exclude (aka "cloak") individual files within folders.
What you can do is setup your build workspace to use the entire /MyCodeFolder folder. Then, in the build for SolutionFileOne.sln you can cloak ProjectFolderA, ProjectFolderB, and ProjectFolderC. In the build for SolutionFileTwo.sln you can cloak ProjectFolder1, ProjectFolder2, and ProjectFolder3.
This is only a partial solution. Both builds will still get kicked off when someone changes either solution file, or when anything in the ProjectFolderCommon folder is changed. Since you can't cloak the solution files themselves there's no way to avoid both builds getting kicked off on a solution file check-in without changing the structure of your files.

Create a branch in a project with its parent under a different project in TFS

I have the following structure:
$/ProjectA [Uses MS Agile Template]
--Branch1
$/ProjectB [Uses Custom Agile Template]
--[To Be Created Branch]
How can I create this new branch in ProjectB that has a parent relation with $/ProjectA/Branch1?
Our requirement says that we cannot be under the same Project because we must use different templates, but we still want to merge the code from new project back to the ProjectA. I checked the option in TFS when you create a new Project that lets you use an existing source control, but problem with that is:
1.There is NO option to bring in specific branches in a Project [Its all or none]
2.I cannot rename that new branch in the new project for some reason
I understand this can be achieved by using a Baseless merge between these 2 projects but I would like to know if there is still a way to have a smooth merge between these 2 branches in different projects.
P.S: we are using VS 2010 with TFS 2010
There's shouldn't be any problems in just branching from one team project into another. You should be able to do this just like you would any branch: just select $/ProjectA/Branch1, select Branch, and enter a branch target path of $/ProjectB/ToBeCreatedBranch.
This is because realistically, Team Projects are of fairly limited scope in TFS version control - it primarily treats the source control tree as a big hierarchy beginning at $/, and team projects are not particularly special, except for some very specialized operations. (Check-in policies are queried for by Team Project, as are settings for locklevels and labels are scoped to Team Projects.)
I'm a little unclear what version control options you specified when you created the new Team Project - you should have just created a new source tree node for it and then you can create your project branches beneath $/ProjectB.

Resources