简体   繁体   English

如何从GIT标签之间的TFS API获取历史记录日志

[英]How to get history log from TFS API between GIT tags

I have Git repositories on TFS server, and using web API I am trying to get a list of commits that happen between two tags. 我在TFS服务器上有Git存储库,并使用Web API尝试获取两个标签之间发生的提交的列表。 Similar way that you can do with CLI: 您可以使用CLI进行类似的操作:

git log TAG_1..TAG_2

but I need this in a web API. 但是我需要在Web API中使用。 please help. 请帮忙。

You could use this REST API to get commits between 2 tags: https://www.visualstudio.com/fr-fr/docs/integrate/api/git/commits#between-two-versions 您可以使用此REST API在2个标签之间进行提交: https : //www.visualstudio.com/fr-fr/docs/integrate/api/git/commits#between-two-versions

Here is an example: 这是一个例子:

POST http://servername:8080/tfs/DefaultCollection/_apis/git/repositories/049d1cfa-a972-405f-923b-fe84c21474e6/commitsBatch?api-version=1.0

Content-Type: application/json

{
  "itemVersion": {
    "versionType": "tag",
    "version": "v1.0"
  },
  "compareVersion": {
    "versionType": "tag",
    "version": "v3.0"
  }
}

Note: Make sure those commits and tags have already pushed into TFS. 注意:确保那些提交和标记已经被推送到TFS中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM