2016-06-14 57 views
0

我正在尝试使用Team Service REST API(https://www.visualstudio.com/en-us/docs/integrate/api/git/commits)获取我的git存储库中某个特定分支中某个特定项目的历史记录。使用TFS REST API获取一个项目在一个分支中的提交

我在我的资源库中有这个结构。

Repository1 -- Branch1 -- Item1 -- Item2 -- Branch2 -- Item1 -- Item3

我怎样才能在Branch1的只是项目1的提交?

我试图POST:https://fabrikam.visualstudio.com/DefaultCollection/_apis/git/repositories/278d5cd2-584d-4b63-824a-2ba458937249/commitsBatch?api-version=1.0

与JSON:

{ "itemVersion": { "versionType": "branch", "version": "Branch1" } }

但是,这让我对整个分支的提交。我如何才能获得该特定分支中该项目的提交?

回答

1

目前没有任何直接获取Rest API的方法,您可以在VSTS User Voice上提交功能请求。

实现此目的的另一种方法是获取指定分支中的所有提交并获取指定项目的所有提交,然后列出两种方案中都存在的提交。

+0

随意如果您想要投票,请投票:https://visualstudio.uservoice.com/forums/330519-team-services/suggestions/14807604-git-rest-api-possibility-to-get-commits-for-one-p – aengas

相关问题