2016-06-14 73 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

相關問題