我能否将 TFS 2017 设置为在创建新团队项目时自动创建源代码分支并在这些分支上配置安全性?

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

我可能会修改一些 TFS 流程模板,以便在使用该模板创建新的团队项目时,get 可以创建一些分支,例如 dev、uat、prod 等。并且只在这些分支上设置权限某些 tfs 组可以签入 prod 分支而不是其他分支。

如果可行,请告诉我。

不,我们不能通过自定义流程模板来实现,流程模板中没有定义创建分支。详情请见Customize a process template

在流程模板中,我们只能通过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.

要创建无基础分支,您可以创建文件夹,然后将文件夹传输到分支。对于普通分支,您可以从一个分支创建到另一个分支。您还可以使用 TFS API 自动创建分支,参考 PowerShell 示例 here。然后添加TFS组并相应设置权限。