Search code examples
tfsalm

Can I setup TFS 2017 to automatically create source code branches and configure security on those branches when a new Team Project is created?


I would like to possibly modify some TFS process templates so that when a new team project is created using that template get could create some branches such as dev, uat, prod, etc. And setup permissions on those branches so only certain tfs groups can check-in to the prod branch vs. the other ones.

Please let me know if this is possible.


Solution

  • No, we cannot achieve that by customizing the process template, Create branch is not defined in the process template. Please see Customize a process template for details.

    In the process template, we can only set the permissions for the user groups related to each branch by Defining the initial configuration of Team Foundation version control and Configure initial groups, teams, members, and permissions.

    Version control has a specific set of permissions that you can configure for a process template. By specifying permissions, you define what actions security groups and individuals can perform on items that are under version control. For more information, see Control access to functional areas.

    To create baseless branches, you can create folders, then transfer the folders to branches. For common branches, you can create from one branch to another. You can also use TFS API to create the branches automatically, reference the PowerShell sample here. Then add the TFS Group and set the permission accordingly.