Commits - Get Commits
检索项目的 git 提交
可以将名称中使用 searchCriteria 前缀的参数指定为查询参数,例如 searchCriteria.$top -> $top
GET https://dev.azure.com/{organization}/{project}/_apis/git/repositories/{repositoryId}/commits?api-version=5.0
GET https://dev.azure.com/{organization}/{project}/_apis/git/repositories/{repositoryId}/commits?searchCriteria.historyMode={searchCriteria.historyMode}&searchCriteria.includePushData={searchCriteria.includePushData}&searchCriteria.includeUserImageUrl={searchCriteria.includeUserImageUrl}&searchCriteria.includeWorkItems={searchCriteria.includeWorkItems}&searchCriteria.includeLinks={searchCriteria.includeLinks}&searchCriteria.$top={searchCriteria.$top}&searchCriteria.$skip={searchCriteria.$skip}&searchCriteria.excludeDeletes={searchCriteria.excludeDeletes}&searchCriteria.itemPath={searchCriteria.itemPath}&searchCriteria.author={searchCriteria.author}&searchCriteria.user={searchCriteria.user}&searchCriteria.toCommitId={searchCriteria.toCommitId}&searchCriteria.fromCommitId={searchCriteria.fromCommitId}&searchCriteria.compareVersion.versionOptions={searchCriteria.compareVersion.versionOptions}&searchCriteria.compareVersion.version={searchCriteria.compareVersion.version}&searchCriteria.compareVersion.versionType={searchCriteria.compareVersion.versionType}&searchCriteria.itemVersion.versionOptions={searchCriteria.itemVersion.versionOptions}&searchCriteria.itemVersion.version={searchCriteria.itemVersion.version}&searchCriteria.itemVersion.versionType={searchCriteria.itemVersion.versionType}&searchCriteria.toDate={searchCriteria.toDate}&searchCriteria.fromDate={searchCriteria.fromDate}&searchCriteria.ids={searchCriteria.ids}&api-version=5.0
URI 参数
名称 | 在 | 必需 | 类型 | 说明 |
---|---|---|---|---|
organization
|
path | True |
string |
Azure DevOps 组织的名称。 |
repository
|
path | True |
string |
存储库的 ID 或友好名称。 若要使用友好名称,还必须指定 projectId。 |
project
|
path |
string |
项目 ID 或项目名称 |
|
api-version
|
query | True |
string |
要使用的 API 版本。 应将其设置为“5.0”才能使用此版本的 API。 |
search
|
query |
integer int32 |
要跳过的条目数 |
|
search
|
query |
integer int32 |
要检索的最大条目数 |
|
search
|
query |
string |
作者的别名或显示名称 |
|
search
|
query |
string |
版本字符串标识符 (标记/分支的名称,提交) 的 SHA1 |
|
search
|
query |
版本选项 - 为版本 (指定其他修饰符,例如上一个) |
||
search
|
query |
版本类型 (分支、标记或提交) 。 确定如何解释 ID |
||
search
|
query |
boolean |
仅在指定 itemPath 时适用。 这确定是否排除指定路径的删除条目。 |
|
search
|
query |
string |
如果提供,则按字母顺序筛选提交的下限 |
|
search
|
query |
string |
如果提供,则仅包括在此日期之后创建的历史记录条目 (字符串) |
|
search
|
query |
应使用哪种 Git 历史记录模式。 这仅适用于 Ids = null 且指定 itemPath 时的搜索条件。 |
||
search
|
query |
string[] |
如果提供,则指定要提取的提交的确切提交 ID。 不能与其他参数组合使用。 |
|
search
|
query |
boolean |
是否在浅表引用中包含_links字段 |
|
search
|
query |
boolean |
是否包含推送信息 |
|
search
|
query |
boolean |
是否包括提交者和作者的图像 URL |
|
search
|
query |
boolean |
是否包括链接的工作项 |
|
search
|
query |
string |
要搜索的项的路径 |
|
search
|
query |
string |
版本字符串标识符 (标记/分支的名称,提交) 的 SHA1 |
|
search
|
query |
版本选项 - 为版本 (指定其他修饰符,例如上一个) |
||
search
|
query |
版本类型 (分支、标记或提交) 。 确定如何解释 ID |
||
search
|
query |
string |
如果提供,则按字母顺序筛选提交的上限 |
|
search
|
query |
string |
如果提供,则仅包括在此日期之前创建的历史记录条目 (字符串) |
|
search
|
query |
string |
提交者的别名或显示名称 |
响应
名称 | 类型 | 说明 |
---|---|---|
200 OK |
成功的操作 |
安全性
oauth2
Type:
oauth2
Flow:
accessCode
Authorization URL:
https://app.vssps.visualstudio.com/oauth2/authorize&response_type=Assertion
Token URL:
https://app.vssps.visualstudio.com/oauth2/token?client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearer&grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer
Scopes
名称 | 说明 |
---|---|
vso.code | 授予读取有关提交、更改集、分支和其他版本控制项目的源代码和元数据的能力。 此外,还允许通过服务挂钩搜索代码并获取有关版本控制事件的通知。 |
示例
All commits |
By author |
By committer |
In a date range |
On a branch |
On a branch and in a path |
Paging |
Reachable from a commit |
Reachable from a commit and path |
All commits
Sample Request
GET https://dev.azure.com/fabrikam/_apis/git/repositories/{repositoryId}/commits?api-version=5.0
Sample Response
{
"count": 8,
"value": [
{
"commitId": "9991b4f66def4c0a9ad8f9f27043ece7eddcf1c7",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:53Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:53Z"
},
"comment": "Merged PR 2: Deleted README.md",
"commentTruncated": true,
"changeCounts": {
"Add": 0,
"Edit": 0,
"Delete": 1
},
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/9991b4f66def4c0a9ad8f9f27043ece7eddcf1c7",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/9991b4f66def4c0a9ad8f9f27043ece7eddcf1c7"
},
{
"commitId": "c771e2e3605c69d2435a6b34b28ac3db2c89efd2",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:38Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:38Z"
},
"comment": "Merge pull request 2 from b2 into master",
"changeCounts": {
"Add": 0,
"Edit": 0,
"Delete": 1
},
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/c771e2e3605c69d2435a6b34b28ac3db2c89efd2",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/c771e2e3605c69d2435a6b34b28ac3db2c89efd2"
},
{
"commitId": "20510720ffe1443d6ed3cb98ca340bc732ba04e5",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:32Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:32Z"
},
"comment": "Deleted README.md",
"changeCounts": {
"Add": 0,
"Edit": 0,
"Delete": 1
},
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/20510720ffe1443d6ed3cb98ca340bc732ba04e5",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/20510720ffe1443d6ed3cb98ca340bc732ba04e5"
},
{
"commitId": "4bac640ecfd017eeadfd282a8e31bcd8ab6d132b",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:17Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:17Z"
},
"comment": "Merged PR 1: Added file debug.log",
"commentTruncated": true,
"changeCounts": {
"Add": 1,
"Edit": 0,
"Delete": 0
},
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/4bac640ecfd017eeadfd282a8e31bcd8ab6d132b",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/4bac640ecfd017eeadfd282a8e31bcd8ab6d132b"
},
{
"commitId": "8921e81180bdf0e8b448be302698e425273e9df0",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:05:28Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:05:28Z"
},
"comment": "Merge pull request 1 from b1 into master",
"changeCounts": {
"Add": 1,
"Edit": 0,
"Delete": 0
},
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/8921e81180bdf0e8b448be302698e425273e9df0",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/8921e81180bdf0e8b448be302698e425273e9df0"
},
{
"commitId": "3104bd0b0accbc74278fe6880e53215f6b93a5cd",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:05:18Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:05:18Z"
},
"comment": "Added file debug.log",
"changeCounts": {
"Add": 1,
"Edit": 0,
"Delete": 0
},
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/3104bd0b0accbc74278fe6880e53215f6b93a5cd",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/3104bd0b0accbc74278fe6880e53215f6b93a5cd"
},
{
"commitId": "9c1e8b082e2c2f041bdd5db76d6bf5c11572524f",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:04:45Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:04:45Z"
},
"comment": "Added file file1.txt",
"changeCounts": {
"Add": 1,
"Edit": 0,
"Delete": 0
},
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/9c1e8b082e2c2f041bdd5db76d6bf5c11572524f",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/9c1e8b082e2c2f041bdd5db76d6bf5c11572524f"
},
{
"commitId": "4fa42e1a7b0215cc70cd4e927cb70c422123af84",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:04:22Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:04:22Z"
},
"comment": "Added README.md file",
"changeCounts": {
"Add": 1,
"Edit": 0,
"Delete": 0
},
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/4fa42e1a7b0215cc70cd4e927cb70c422123af84",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/4fa42e1a7b0215cc70cd4e927cb70c422123af84"
}
]
}
By author
Sample Request
GET https://dev.azure.com/fabrikam/_apis/git/repositories/{repositoryId}/commits?searchCriteria.author=Norman Paulk&api-version=5.0
Sample Response
{
"count": 8,
"value": [
{
"commitId": "9991b4f66def4c0a9ad8f9f27043ece7eddcf1c7",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:53Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:53Z"
},
"comment": "Merged PR 2: Deleted README.md",
"commentTruncated": true,
"changeCounts": {
"Add": 0,
"Edit": 0,
"Delete": 1
},
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/9991b4f66def4c0a9ad8f9f27043ece7eddcf1c7",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/9991b4f66def4c0a9ad8f9f27043ece7eddcf1c7"
},
{
"commitId": "c771e2e3605c69d2435a6b34b28ac3db2c89efd2",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:38Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:38Z"
},
"comment": "Merge pull request 2 from b2 into master",
"changeCounts": {
"Add": 0,
"Edit": 0,
"Delete": 1
},
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/c771e2e3605c69d2435a6b34b28ac3db2c89efd2",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/c771e2e3605c69d2435a6b34b28ac3db2c89efd2"
},
{
"commitId": "20510720ffe1443d6ed3cb98ca340bc732ba04e5",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:32Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:32Z"
},
"comment": "Deleted README.md",
"changeCounts": {
"Add": 0,
"Edit": 0,
"Delete": 1
},
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/20510720ffe1443d6ed3cb98ca340bc732ba04e5",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/20510720ffe1443d6ed3cb98ca340bc732ba04e5"
},
{
"commitId": "4bac640ecfd017eeadfd282a8e31bcd8ab6d132b",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:17Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:17Z"
},
"comment": "Merged PR 1: Added file debug.log",
"commentTruncated": true,
"changeCounts": {
"Add": 1,
"Edit": 0,
"Delete": 0
},
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/4bac640ecfd017eeadfd282a8e31bcd8ab6d132b",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/4bac640ecfd017eeadfd282a8e31bcd8ab6d132b"
},
{
"commitId": "8921e81180bdf0e8b448be302698e425273e9df0",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:05:28Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:05:28Z"
},
"comment": "Merge pull request 1 from b1 into master",
"changeCounts": {
"Add": 1,
"Edit": 0,
"Delete": 0
},
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/8921e81180bdf0e8b448be302698e425273e9df0",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/8921e81180bdf0e8b448be302698e425273e9df0"
},
{
"commitId": "3104bd0b0accbc74278fe6880e53215f6b93a5cd",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:05:18Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:05:18Z"
},
"comment": "Added file debug.log",
"changeCounts": {
"Add": 1,
"Edit": 0,
"Delete": 0
},
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/3104bd0b0accbc74278fe6880e53215f6b93a5cd",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/3104bd0b0accbc74278fe6880e53215f6b93a5cd"
},
{
"commitId": "9c1e8b082e2c2f041bdd5db76d6bf5c11572524f",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:04:45Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:04:45Z"
},
"comment": "Added file file1.txt",
"changeCounts": {
"Add": 1,
"Edit": 0,
"Delete": 0
},
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/9c1e8b082e2c2f041bdd5db76d6bf5c11572524f",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/9c1e8b082e2c2f041bdd5db76d6bf5c11572524f"
},
{
"commitId": "4fa42e1a7b0215cc70cd4e927cb70c422123af84",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:04:22Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:04:22Z"
},
"comment": "Added README.md file",
"changeCounts": {
"Add": 1,
"Edit": 0,
"Delete": 0
},
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/4fa42e1a7b0215cc70cd4e927cb70c422123af84",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/4fa42e1a7b0215cc70cd4e927cb70c422123af84"
}
]
}
By committer
Sample Request
GET https://dev.azure.com/fabrikam/_apis/git/repositories/{repositoryId}/commits?searchCriteria.user=shsamy@microsoft.com&api-version=5.0
Sample Response
{
"count": 8,
"value": [
{
"commitId": "9991b4f66def4c0a9ad8f9f27043ece7eddcf1c7",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:53Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:53Z"
},
"comment": "Merged PR 2: Deleted README.md",
"commentTruncated": true,
"changeCounts": {
"Add": 0,
"Edit": 0,
"Delete": 1
},
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/9991b4f66def4c0a9ad8f9f27043ece7eddcf1c7",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/9991b4f66def4c0a9ad8f9f27043ece7eddcf1c7"
},
{
"commitId": "c771e2e3605c69d2435a6b34b28ac3db2c89efd2",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:38Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:38Z"
},
"comment": "Merge pull request 2 from b2 into master",
"changeCounts": {
"Add": 0,
"Edit": 0,
"Delete": 1
},
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/c771e2e3605c69d2435a6b34b28ac3db2c89efd2",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/c771e2e3605c69d2435a6b34b28ac3db2c89efd2"
},
{
"commitId": "20510720ffe1443d6ed3cb98ca340bc732ba04e5",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:32Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:32Z"
},
"comment": "Deleted README.md",
"changeCounts": {
"Add": 0,
"Edit": 0,
"Delete": 1
},
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/20510720ffe1443d6ed3cb98ca340bc732ba04e5",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/20510720ffe1443d6ed3cb98ca340bc732ba04e5"
},
{
"commitId": "4bac640ecfd017eeadfd282a8e31bcd8ab6d132b",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:17Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:17Z"
},
"comment": "Merged PR 1: Added file debug.log",
"commentTruncated": true,
"changeCounts": {
"Add": 1,
"Edit": 0,
"Delete": 0
},
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/4bac640ecfd017eeadfd282a8e31bcd8ab6d132b",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/4bac640ecfd017eeadfd282a8e31bcd8ab6d132b"
},
{
"commitId": "8921e81180bdf0e8b448be302698e425273e9df0",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:05:28Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:05:28Z"
},
"comment": "Merge pull request 1 from b1 into master",
"changeCounts": {
"Add": 1,
"Edit": 0,
"Delete": 0
},
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/8921e81180bdf0e8b448be302698e425273e9df0",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/8921e81180bdf0e8b448be302698e425273e9df0"
},
{
"commitId": "3104bd0b0accbc74278fe6880e53215f6b93a5cd",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:05:18Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:05:18Z"
},
"comment": "Added file debug.log",
"changeCounts": {
"Add": 1,
"Edit": 0,
"Delete": 0
},
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/3104bd0b0accbc74278fe6880e53215f6b93a5cd",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/3104bd0b0accbc74278fe6880e53215f6b93a5cd"
},
{
"commitId": "9c1e8b082e2c2f041bdd5db76d6bf5c11572524f",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:04:45Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:04:45Z"
},
"comment": "Added file file1.txt",
"changeCounts": {
"Add": 1,
"Edit": 0,
"Delete": 0
},
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/9c1e8b082e2c2f041bdd5db76d6bf5c11572524f",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/9c1e8b082e2c2f041bdd5db76d6bf5c11572524f"
},
{
"commitId": "4fa42e1a7b0215cc70cd4e927cb70c422123af84",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:04:22Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:04:22Z"
},
"comment": "Added README.md file",
"changeCounts": {
"Add": 1,
"Edit": 0,
"Delete": 0
},
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/4fa42e1a7b0215cc70cd4e927cb70c422123af84",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/4fa42e1a7b0215cc70cd4e927cb70c422123af84"
}
]
}
In a date range
Sample Request
GET https://dev.azure.com/fabrikam/_apis/git/repositories/{repositoryId}/commits?searchCriteria.toDate=6/16/2018 12:00:00 AM&searchCriteria.fromDate=6/14/2018 12:00:00 AM&api-version=5.0
Sample Response
{
"count": 8,
"value": [
{
"commitId": "9991b4f66def4c0a9ad8f9f27043ece7eddcf1c7",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:53Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:53Z"
},
"comment": "Merged PR 2: Deleted README.md",
"commentTruncated": true,
"changeCounts": {
"Add": 0,
"Edit": 0,
"Delete": 1
},
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/9991b4f66def4c0a9ad8f9f27043ece7eddcf1c7",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/9991b4f66def4c0a9ad8f9f27043ece7eddcf1c7"
},
{
"commitId": "c771e2e3605c69d2435a6b34b28ac3db2c89efd2",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:38Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:38Z"
},
"comment": "Merge pull request 2 from b2 into master",
"changeCounts": {
"Add": 0,
"Edit": 0,
"Delete": 1
},
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/c771e2e3605c69d2435a6b34b28ac3db2c89efd2",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/c771e2e3605c69d2435a6b34b28ac3db2c89efd2"
},
{
"commitId": "20510720ffe1443d6ed3cb98ca340bc732ba04e5",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:32Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:32Z"
},
"comment": "Deleted README.md",
"changeCounts": {
"Add": 0,
"Edit": 0,
"Delete": 1
},
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/20510720ffe1443d6ed3cb98ca340bc732ba04e5",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/20510720ffe1443d6ed3cb98ca340bc732ba04e5"
},
{
"commitId": "4bac640ecfd017eeadfd282a8e31bcd8ab6d132b",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:17Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:17Z"
},
"comment": "Merged PR 1: Added file debug.log",
"commentTruncated": true,
"changeCounts": {
"Add": 1,
"Edit": 0,
"Delete": 0
},
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/4bac640ecfd017eeadfd282a8e31bcd8ab6d132b",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/4bac640ecfd017eeadfd282a8e31bcd8ab6d132b"
},
{
"commitId": "8921e81180bdf0e8b448be302698e425273e9df0",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:05:28Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:05:28Z"
},
"comment": "Merge pull request 1 from b1 into master",
"changeCounts": {
"Add": 1,
"Edit": 0,
"Delete": 0
},
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/8921e81180bdf0e8b448be302698e425273e9df0",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/8921e81180bdf0e8b448be302698e425273e9df0"
},
{
"commitId": "3104bd0b0accbc74278fe6880e53215f6b93a5cd",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:05:18Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:05:18Z"
},
"comment": "Added file debug.log",
"changeCounts": {
"Add": 1,
"Edit": 0,
"Delete": 0
},
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/3104bd0b0accbc74278fe6880e53215f6b93a5cd",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/3104bd0b0accbc74278fe6880e53215f6b93a5cd"
},
{
"commitId": "9c1e8b082e2c2f041bdd5db76d6bf5c11572524f",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:04:45Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:04:45Z"
},
"comment": "Added file file1.txt",
"changeCounts": {
"Add": 1,
"Edit": 0,
"Delete": 0
},
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/9c1e8b082e2c2f041bdd5db76d6bf5c11572524f",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/9c1e8b082e2c2f041bdd5db76d6bf5c11572524f"
},
{
"commitId": "4fa42e1a7b0215cc70cd4e927cb70c422123af84",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:04:22Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:04:22Z"
},
"comment": "Added README.md file",
"changeCounts": {
"Add": 1,
"Edit": 0,
"Delete": 0
},
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/4fa42e1a7b0215cc70cd4e927cb70c422123af84",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/4fa42e1a7b0215cc70cd4e927cb70c422123af84"
}
]
}
On a branch
Sample Request
GET https://dev.azure.com/fabrikam/_apis/git/repositories/{repositoryId}/commits?searchCriteria.itemVersion.version=master&api-version=5.0
Sample Response
link: <9991b4f66def4c0a9ad8f9f27043ece7eddcf1c7>;rel="startingCommitId"
{
"count": 6,
"value": [
{
"commitId": "9991b4f66def4c0a9ad8f9f27043ece7eddcf1c7",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:53Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:53Z"
},
"comment": "Merged PR 2: Deleted README.md",
"commentTruncated": true,
"changeCounts": {
"Add": 0,
"Edit": 0,
"Delete": 1
},
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/9991b4f66def4c0a9ad8f9f27043ece7eddcf1c7",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/9991b4f66def4c0a9ad8f9f27043ece7eddcf1c7"
},
{
"commitId": "20510720ffe1443d6ed3cb98ca340bc732ba04e5",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:32Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:32Z"
},
"comment": "Deleted README.md",
"changeCounts": {
"Add": 0,
"Edit": 0,
"Delete": 1
},
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/20510720ffe1443d6ed3cb98ca340bc732ba04e5",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/20510720ffe1443d6ed3cb98ca340bc732ba04e5"
},
{
"commitId": "4bac640ecfd017eeadfd282a8e31bcd8ab6d132b",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:17Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:17Z"
},
"comment": "Merged PR 1: Added file debug.log",
"commentTruncated": true,
"changeCounts": {
"Add": 1,
"Edit": 0,
"Delete": 0
},
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/4bac640ecfd017eeadfd282a8e31bcd8ab6d132b",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/4bac640ecfd017eeadfd282a8e31bcd8ab6d132b"
},
{
"commitId": "3104bd0b0accbc74278fe6880e53215f6b93a5cd",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:05:18Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:05:18Z"
},
"comment": "Added file debug.log",
"changeCounts": {
"Add": 1,
"Edit": 0,
"Delete": 0
},
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/3104bd0b0accbc74278fe6880e53215f6b93a5cd",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/3104bd0b0accbc74278fe6880e53215f6b93a5cd"
},
{
"commitId": "9c1e8b082e2c2f041bdd5db76d6bf5c11572524f",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:04:45Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:04:45Z"
},
"comment": "Added file file1.txt",
"changeCounts": {
"Add": 1,
"Edit": 0,
"Delete": 0
},
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/9c1e8b082e2c2f041bdd5db76d6bf5c11572524f",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/9c1e8b082e2c2f041bdd5db76d6bf5c11572524f"
},
{
"commitId": "4fa42e1a7b0215cc70cd4e927cb70c422123af84",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:04:22Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:04:22Z"
},
"comment": "Added README.md file",
"changeCounts": {
"Add": 1,
"Edit": 0,
"Delete": 0
},
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/4fa42e1a7b0215cc70cd4e927cb70c422123af84",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/4fa42e1a7b0215cc70cd4e927cb70c422123af84"
}
]
}
On a branch and in a path
Sample Request
GET https://dev.azure.com/fabrikam/_apis/git/repositories/{repositoryId}/commits?searchCriteria.itemPath=/debug.log&searchCriteria.itemVersion.version=master&api-version=5.0
Sample Response
link: <9991b4f66def4c0a9ad8f9f27043ece7eddcf1c7>;rel="startingCommitId"
{
"count": 1,
"value": [
{
"commitId": "3104bd0b0accbc74278fe6880e53215f6b93a5cd",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:05:18Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:05:18Z"
},
"comment": "Added file debug.log",
"changeCounts": {
"Add": 1,
"Edit": 0,
"Delete": 0
},
"changes": [
{
"sourceServerItem": "/debug.log",
"changeType": "add"
}
],
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/3104bd0b0accbc74278fe6880e53215f6b93a5cd",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/3104bd0b0accbc74278fe6880e53215f6b93a5cd"
}
]
}
Paging
Sample Request
GET https://dev.azure.com/fabrikam/_apis/git/repositories/{repositoryId}/commits?api-version=5.0
Sample Response
link: ;rel="next"
{
"count": 2,
"value": [
{
"commitId": "c771e2e3605c69d2435a6b34b28ac3db2c89efd2",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:38Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:38Z"
},
"comment": "Merge pull request 2 from b2 into master",
"changeCounts": {
"Add": 0,
"Edit": 0,
"Delete": 1
},
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/c771e2e3605c69d2435a6b34b28ac3db2c89efd2",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/c771e2e3605c69d2435a6b34b28ac3db2c89efd2"
},
{
"commitId": "20510720ffe1443d6ed3cb98ca340bc732ba04e5",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:32Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:32Z"
},
"comment": "Deleted README.md",
"changeCounts": {
"Add": 0,
"Edit": 0,
"Delete": 1
},
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/20510720ffe1443d6ed3cb98ca340bc732ba04e5",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/20510720ffe1443d6ed3cb98ca340bc732ba04e5"
}
]
}
Reachable from a commit
Sample Request
GET https://dev.azure.com/fabrikam/_apis/git/repositories/{repositoryId}/commits?searchCriteria.compareVersion.version=4fa42e1a7b0215cc70cd4e927cb70c422123af84&searchCriteria.compareVersion.versionType=commit&api-version=5.0
Sample Response
{
"count": 8,
"value": [
{
"commitId": "9991b4f66def4c0a9ad8f9f27043ece7eddcf1c7",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:53Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:53Z"
},
"comment": "Merged PR 2: Deleted README.md",
"commentTruncated": true,
"changeCounts": {
"Add": 0,
"Edit": 0,
"Delete": 1
},
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/9991b4f66def4c0a9ad8f9f27043ece7eddcf1c7",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/9991b4f66def4c0a9ad8f9f27043ece7eddcf1c7"
},
{
"commitId": "c771e2e3605c69d2435a6b34b28ac3db2c89efd2",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:38Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:38Z"
},
"comment": "Merge pull request 2 from b2 into master",
"changeCounts": {
"Add": 0,
"Edit": 0,
"Delete": 1
},
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/c771e2e3605c69d2435a6b34b28ac3db2c89efd2",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/c771e2e3605c69d2435a6b34b28ac3db2c89efd2"
},
{
"commitId": "20510720ffe1443d6ed3cb98ca340bc732ba04e5",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:32Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:32Z"
},
"comment": "Deleted README.md",
"changeCounts": {
"Add": 0,
"Edit": 0,
"Delete": 1
},
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/20510720ffe1443d6ed3cb98ca340bc732ba04e5",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/20510720ffe1443d6ed3cb98ca340bc732ba04e5"
},
{
"commitId": "4bac640ecfd017eeadfd282a8e31bcd8ab6d132b",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:17Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:17Z"
},
"comment": "Merged PR 1: Added file debug.log",
"commentTruncated": true,
"changeCounts": {
"Add": 1,
"Edit": 0,
"Delete": 0
},
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/4bac640ecfd017eeadfd282a8e31bcd8ab6d132b",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/4bac640ecfd017eeadfd282a8e31bcd8ab6d132b"
},
{
"commitId": "8921e81180bdf0e8b448be302698e425273e9df0",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:05:28Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:05:28Z"
},
"comment": "Merge pull request 1 from b1 into master",
"changeCounts": {
"Add": 1,
"Edit": 0,
"Delete": 0
},
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/8921e81180bdf0e8b448be302698e425273e9df0",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/8921e81180bdf0e8b448be302698e425273e9df0"
},
{
"commitId": "3104bd0b0accbc74278fe6880e53215f6b93a5cd",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:05:18Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:05:18Z"
},
"comment": "Added file debug.log",
"changeCounts": {
"Add": 1,
"Edit": 0,
"Delete": 0
},
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/3104bd0b0accbc74278fe6880e53215f6b93a5cd",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/3104bd0b0accbc74278fe6880e53215f6b93a5cd"
},
{
"commitId": "9c1e8b082e2c2f041bdd5db76d6bf5c11572524f",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:04:45Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:04:45Z"
},
"comment": "Added file file1.txt",
"changeCounts": {
"Add": 1,
"Edit": 0,
"Delete": 0
},
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/9c1e8b082e2c2f041bdd5db76d6bf5c11572524f",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/9c1e8b082e2c2f041bdd5db76d6bf5c11572524f"
},
{
"commitId": "4fa42e1a7b0215cc70cd4e927cb70c422123af84",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:04:22Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:04:22Z"
},
"comment": "Added README.md file",
"changeCounts": {
"Add": 1,
"Edit": 0,
"Delete": 0
},
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/4fa42e1a7b0215cc70cd4e927cb70c422123af84",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/4fa42e1a7b0215cc70cd4e927cb70c422123af84"
}
]
}
Reachable from a commit and path
Sample Request
GET https://dev.azure.com/fabrikam/_apis/git/repositories/{repositoryId}/commits?searchCriteria.itemPath=/README.md&searchCriteria.compareVersion.version=master&searchCriteria.itemVersion.version=4fa42e1a7b0215cc70cd4e927cb70c422123af84&searchCriteria.itemVersion.versionType=commit&api-version=5.0
Sample Response
link: <4fa42e1a7b0215cc70cd4e927cb70c422123af84>;rel="startingCommitId"
{
"count": 1,
"value": [
{
"commitId": "20510720ffe1443d6ed3cb98ca340bc732ba04e5",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:32Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:32Z"
},
"comment": "Deleted README.md",
"changeCounts": {
"Add": 0,
"Edit": 0,
"Delete": 1
},
"changes": [
{
"sourceServerItem": "/README.md",
"changeType": "delete"
}
],
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/20510720ffe1443d6ed3cb98ca340bc732ba04e5",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/20510720ffe1443d6ed3cb98ca340bc732ba04e5"
}
]
}
定义
名称 | 说明 |
---|---|
Change |
|
Git |
|
Git |
提供描述 Git 提交和关联元数据的属性。 |
Git |
应使用哪种 Git 历史记录模式。 这仅适用于 Ids = null 且指定 itemPath 时的搜索条件。 |
Git |
|
Git |
此类包含发布状态的服务/扩展的元数据。 |
Git |
唯一标识状态的状态上下文。 |
Git |
状态的状态。 |
Git |
|
Git |
Git 操作的用户信息和日期。 |
Git |
版本选项 - 指定版本 (的其他修饰符,例如上一) |
Git |
版本类型 (分支、标记或提交) 。 确定如何解释 ID |
Identity |
|
Item |
|
Item |
|
Reference |
表示 REST 引用链接集合的类。 |
Resource |
|
Version |
对项所做的更改的类型。 |
ChangeCountDictionary
GitChange
名称 | 类型 | 说明 |
---|---|---|
changeId |
integer |
更改组中更改的 ID。 |
changeType |
对项所做的更改的类型。 |
|
item |
string |
当前版本。 |
newContent |
更改后的项的内容。 |
|
newContentTemplate |
推送新更改时要使用的新内容模板。 |
|
originalPath |
string |
项的原始路径(如果不同于当前路径)。 |
sourceServerItem |
string |
服务器上的项的路径。 |
url |
string |
用于检索项的 URL。 |
GitCommitRef
提供描述 Git 提交和关联元数据的属性。
名称 | 类型 | 说明 |
---|---|---|
_links |
相关 REST 引用链接的集合。 |
|
author |
提交的作者。 |
|
changeCounts |
提交中包括的更改类型 (编辑、删除等) 计数。 |
|
changes |
提交中包括的更改的枚举。 |
|
comment |
string |
提交的注释或消息。 |
commentTruncated |
boolean |
指示注释是否从完整的 Git 提交注释消息中截断。 |
commitId |
string |
提交的 ID (SHA-1) 。 |
committer |
提交的提交者。 |
|
parents |
string[] |
此提交的父提交 ID 的枚举。 |
push |
与此提交关联的推送。 |
|
remoteUrl |
string |
提交的远程 URL 路径。 |
statuses |
来自服务和扩展的状态元数据列表,这些元数据可能会将其他信息关联到提交。 |
|
url |
string |
此资源的 REST URL。 |
workItems |
与此提交关联的工作项列表。 |
GitHistoryMode
应使用哪种 Git 历史记录模式。 这仅适用于 Ids = null 且指定 itemPath 时的搜索条件。
名称 | 类型 | 说明 |
---|---|---|
firstParent |
string |
使用的历史记录模式 |
fullHistory |
string |
使用的历史记录模式 |
fullHistorySimplifyMerges |
string |
使用的历史记录模式 |
simplifiedHistory |
string |
使用的 |
GitPushRef
名称 | 类型 | 说明 |
---|---|---|
_links |
表示 REST 引用链接集合的类。 |
|
date |
string |
|
pushId |
integer |
|
pushedBy | ||
url |
string |
GitStatus
此类包含发布状态的服务/扩展的元数据。
名称 | 类型 | 说明 |
---|---|---|
_links |
参考链接。 |
|
context |
状态的上下文。 |
|
createdBy |
创建状态的标识。 |
|
creationDate |
string |
状态的创建日期和时间。 |
description |
string |
状态说明。 通常描述状态的当前状态。 |
id |
integer |
状态标识符。 |
state |
状态的状态。 |
|
targetUrl |
string |
包含状态详细信息的 URL。 |
updatedDate |
string |
状态的上次更新日期和时间。 |
GitStatusContext
唯一标识状态的状态上下文。
名称 | 类型 | 说明 |
---|---|---|
genre |
string |
状态的流派。 生成状态的服务/工具的名称通常可以为空。 |
name |
string |
状态的名称标识符不能为 null 或空。 |
GitStatusState
状态的状态。
名称 | 类型 | 说明 |
---|---|---|
error |
string |
出现错误的状态。 |
failed |
string |
状态失败。 |
notApplicable |
string |
状态不适用于目标对象。 |
notSet |
string |
未设置状态。 默认状态。 |
pending |
string |
状态挂起。 |
succeeded |
string |
状态成功。 |
GitTemplate
名称 | 类型 | 说明 |
---|---|---|
name |
string |
模板的名称 |
type |
string |
模板的类型 |
GitUserDate
Git 操作的用户信息和日期。
名称 | 类型 | 说明 |
---|---|---|
date |
string |
Git 操作的日期。 |
string |
Email执行 Git 操作的用户的地址。 |
|
imageUrl |
string |
用户头像的 URL。 |
name |
string |
执行 Git 操作的用户的名称。 |
GitVersionOptions
版本选项 - 指定版本 (的其他修饰符,例如上一)
名称 | 类型 | 说明 |
---|---|---|
firstParent |
string |
提交 (HEAD^) 的第一个父级 |
none |
string |
未指定 |
previousChange |
string |
在当前版本之前已更改项的提交 |
GitVersionType
版本类型 (分支、标记或提交) 。 确定如何解释 ID
名称 | 类型 | 说明 |
---|---|---|
branch |
string |
将版本解释为分支名称 |
commit |
string |
将版本解释为提交 ID (SHA1) |
tag |
string |
将版本解释为标记名称 |
IdentityRef
名称 | 类型 | 说明 |
---|---|---|
_links |
此字段包含有关图形主题的零个或多个相关链接。 可以调用这些链接来获取有关此图主题的其他关系或更多详细信息。 |
|
descriptor |
string |
描述符是在系统运行时引用图形主题的主要方式。 此字段将唯一标识帐户和组织中的同一图形主题。 |
directoryAlias |
string |
|
displayName |
string |
这是图形主题的非唯一显示名称。 若要更改此字段,必须在源提供程序中更改其值。 |
id |
string |
|
imageUrl |
string |
|
inactive |
boolean |
|
isAadIdentity |
boolean |
|
isContainer |
boolean |
|
isDeletedInOrigin |
boolean |
|
profileUrl |
string |
|
uniqueName |
string |
|
url |
string |
此 URL 是此图主题的源资源的完整路由。 |
ItemContent
名称 | 类型 | 说明 |
---|---|---|
content |
string |
|
contentType |
ItemContentType
名称 | 类型 | 说明 |
---|---|---|
base64Encoded |
string |
|
rawText |
string |
ReferenceLinks
表示 REST 引用链接集合的类。
名称 | 类型 | 说明 |
---|---|---|
links |
object |
链接的只读视图。 由于引用链接是只读的,因此我们只想将其公开为只读。 |
ResourceRef
名称 | 类型 | 说明 |
---|---|---|
id |
string |
|
url |
string |
VersionControlChangeType
对项所做的更改的类型。
名称 | 类型 | 说明 |
---|---|---|
add |
string |
|
all |
string |
|
branch |
string |
|
delete |
string |
|
edit |
string |
|
encoding |
string |
|
lock |
string |
|
merge |
string |
|
none |
string |
|
property |
string |
|
rename |
string |
|
rollback |
string |
|
sourceRename |
string |
|
targetRename |
string |
|
undelete |
string |