用于创建TFVC分支的VSTS REST API [英] VSTS REST API for creating TFVC Branch
问题描述
我正在尝试使一些与构建有关的任务自动化,包括创建新的发行分支和为每个发行版建立定义.我使用 VSTS TFVC 进行版本管理.当我尝试使用TFS REST API进行操作时,找不到用于创建分支的任何API(
I am trying to automate some of my build related tasks, which includes creating new release branch and build definitions for each release. I use VSTS TFVC for version management. When i am trying to do it with TFS REST API, i couldn't find any API for creating branch (microsoft documentation).
我可以看到.NET API ;无法找到一种作为REST API.
I can see .NET API available to do this; unable to find one as REST API.
推荐答案
No such a REST API to create branch for now, I have submitted a user voice here to suggest the feature, you can go and vote it up to achieve that in future.
作为一种解决方法,您可以尝试以下方法在代码或脚本中创建分支:
As a workaround you can try below ways to create a branch in code or script:
- 就像@Shayki提到的那样,您可以使用客户端对象模型参考(如果要以编程方式管理版本控制).只需使用"
CreateBranch()
"方法即可 Microsoft.TeamFoundation.VersionControl.Client.VersionControlServer 类以创建分支. - 此外,您还可以使用分支命令创建分支.
- Just as @Shayki mentioned you can use Client Object Model Reference
if you want to manage the Version Control programmatically.
Just use the "
CreateBranch()
" method in Microsoft.TeamFoundation.VersionControl.Client.VersionControlServer class to create a branch. - Besides, you can also use the Branch Command to create a branch.
tf branch olditem newitem [/version:versionspec] [/noget] [/lock:(none|checkin|checkout)] [/noprompt] [/silent] [/checkin] [/comment:("comment"|@commentfile)] [/author:authorname] [/login:username, [password]] [/recursive]
这篇关于用于创建TFVC分支的VSTS REST API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!