用于创建TFVC分支的VSTS REST API [英] VSTS REST API for creating TFVC Branch

查看:94
本文介绍了用于创建TFVC分支的VSTS REST API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使一些与构建有关的任务自动化,包括创建新的发行分支和为每个发行版建立定义.我使用 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.

推荐答案

目前尚无此类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:

  • 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆