且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

用于创建TFVC分支的VSTS REST API

更新时间:2023-09-08 18:32:04

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