Commits - Get Commits
Retrieve git commits for a project
Parameters that use the searchCriteria prefix in their name can be specified without it as query parameters, e.g. 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 Parameters
Name | In | Required | Type | Description |
---|---|---|---|---|
organization
|
path | True |
string |
The name of the Azure DevOps organization. |
repository
|
path | True |
string |
The id or friendly name of the repository. To use the friendly name, projectId must also be specified. |
project
|
path |
string |
Project ID or project name |
|
api-version
|
query | True |
string |
Version of the API to use. This should be set to '5.0' to use this version of the api. |
search
|
query |
integer int32 |
Number of entries to skip |
|
search
|
query |
integer int32 |
Maximum number of entries to retrieve |
|
search
|
query |
string |
Alias or display name of the author |
|
search
|
query |
string |
Version string identifier (name of tag/branch, SHA1 of commit) |
|
search
|
query |
Version options - Specify additional modifiers to version (e.g Previous) |
||
search
|
query |
Version type (branch, tag, or commit). Determines how Id is interpreted |
||
search
|
query |
boolean |
Only applies when an itemPath is specified. This determines whether to exclude delete entries of the specified path. |
|
search
|
query |
string |
If provided, a lower bound for filtering commits alphabetically |
|
search
|
query |
string |
If provided, only include history entries created after this date (string) |
|
search
|
query |
What Git history mode should be used. This only applies to the search criteria when Ids = null and an itemPath is specified. |
||
search
|
query |
string[] |
If provided, specifies the exact commit ids of the commits to fetch. May not be combined with other parameters. |
|
search
|
query |
boolean |
Whether to include the _links field on the shallow references |
|
search
|
query |
boolean |
Whether to include the push information |
|
search
|
query |
boolean |
Whether to include the image Url for committers and authors |
|
search
|
query |
boolean |
Whether to include linked work items |
|
search
|
query |
string |
Path of item to search under |
|
search
|
query |
string |
Version string identifier (name of tag/branch, SHA1 of commit) |
|
search
|
query |
Version options - Specify additional modifiers to version (e.g Previous) |
||
search
|
query |
Version type (branch, tag, or commit). Determines how Id is interpreted |
||
search
|
query |
string |
If provided, an upper bound for filtering commits alphabetically |
|
search
|
query |
string |
If provided, only include history entries created before this date (string) |
|
search
|
query |
string |
Alias or display name of the committer |
Responses
Name | Type | Description |
---|---|---|
200 OK |
successful operation |
Security
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
Name | Description |
---|---|
vso.code | Grants the ability to read source code and metadata about commits, changesets, branches, and other version control artifacts. Also grants the ability to search code and get notified about version control events via service hooks. |
Examples
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"
}
]
}
Definitions
Name | Description |
---|---|
Change |
|
Git |
|
Git |
Provides properties that describe a Git commit and associated metadata. |
Git |
What Git history mode should be used. This only applies to the search criteria when Ids = null and an itemPath is specified. |
Git |
|
Git |
This class contains the metadata of a service/extension posting a status. |
Git |
Status context that uniquely identifies the status. |
Git |
State of the status. |
Git |
|
Git |
User info and date for Git operations. |
Git |
Version options - Specify additional modifiers to version (e.g Previous) |
Git |
Version type (branch, tag, or commit). Determines how Id is interpreted |
Identity |
|
Item |
|
Item |
|
Reference |
The class to represent a collection of REST reference links. |
Resource |
|
Version |
The type of change that was made to the item. |
ChangeCountDictionary
GitChange
Name | Type | Description |
---|---|---|
changeId |
integer |
ID of the change within the group of changes. |
changeType |
The type of change that was made to the item. |
|
item |
string |
Current version. |
newContent |
Content of the item after the change. |
|
newContentTemplate |
New Content template to be used when pushing new changes. |
|
originalPath |
string |
Original path of item if different from current path. |
sourceServerItem |
string |
Path of the item on the server. |
url |
string |
URL to retrieve the item. |
GitCommitRef
Provides properties that describe a Git commit and associated metadata.
Name | Type | Description |
---|---|---|
_links |
A collection of related REST reference links. |
|
author |
Author of the commit. |
|
changeCounts |
Counts of the types of changes (edits, deletes, etc.) included with the commit. |
|
changes |
An enumeration of the changes included with the commit. |
|
comment |
string |
Comment or message of the commit. |
commentTruncated |
boolean |
Indicates if the comment is truncated from the full Git commit comment message. |
commitId |
string |
ID (SHA-1) of the commit. |
committer |
Committer of the commit. |
|
parents |
string[] |
An enumeration of the parent commit IDs for this commit. |
push |
The push associated with this commit. |
|
remoteUrl |
string |
Remote URL path to the commit. |
statuses |
A list of status metadata from services and extensions that may associate additional information to the commit. |
|
url |
string |
REST URL for this resource. |
workItems |
A list of workitems associated with this commit. |
GitHistoryMode
What Git history mode should be used. This only applies to the search criteria when Ids = null and an itemPath is specified.
Name | Type | Description |
---|---|---|
firstParent |
string |
The history mode used by |
fullHistory |
string |
The history mode used by |
fullHistorySimplifyMerges |
string |
The history mode used by |
simplifiedHistory |
string |
The history mode used by |
GitPushRef
Name | Type | Description |
---|---|---|
_links |
The class to represent a collection of REST reference links. |
|
date |
string |
|
pushId |
integer |
|
pushedBy | ||
url |
string |
GitStatus
This class contains the metadata of a service/extension posting a status.
Name | Type | Description |
---|---|---|
_links |
Reference links. |
|
context |
Context of the status. |
|
createdBy |
Identity that created the status. |
|
creationDate |
string |
Creation date and time of the status. |
description |
string |
Status description. Typically describes current state of the status. |
id |
integer |
Status identifier. |
state |
State of the status. |
|
targetUrl |
string |
URL with status details. |
updatedDate |
string |
Last update date and time of the status. |
GitStatusContext
Status context that uniquely identifies the status.
Name | Type | Description |
---|---|---|
genre |
string |
Genre of the status. Typically name of the service/tool generating the status, can be empty. |
name |
string |
Name identifier of the status, cannot be null or empty. |
GitStatusState
State of the status.
Name | Type | Description |
---|---|---|
error |
string |
Status with an error. |
failed |
string |
Status failed. |
notApplicable |
string |
Status is not applicable to the target object. |
notSet |
string |
Status state not set. Default state. |
pending |
string |
Status pending. |
succeeded |
string |
Status succeeded. |
GitTemplate
Name | Type | Description |
---|---|---|
name |
string |
Name of the Template |
type |
string |
Type of the Template |
GitUserDate
User info and date for Git operations.
Name | Type | Description |
---|---|---|
date |
string |
Date of the Git operation. |
string |
Email address of the user performing the Git operation. |
|
imageUrl |
string |
Url for the user's avatar. |
name |
string |
Name of the user performing the Git operation. |
GitVersionOptions
Version options - Specify additional modifiers to version (e.g Previous)
Name | Type | Description |
---|---|---|
firstParent |
string |
First parent of commit (HEAD^) |
none |
string |
Not specified |
previousChange |
string |
Commit that changed item prior to the current version |
GitVersionType
Version type (branch, tag, or commit). Determines how Id is interpreted
Name | Type | Description |
---|---|---|
branch |
string |
Interpret the version as a branch name |
commit |
string |
Interpret the version as a commit ID (SHA1) |
tag |
string |
Interpret the version as a tag name |
IdentityRef
Name | Type | Description |
---|---|---|
_links |
This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. |
|
descriptor |
string |
The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. |
directoryAlias |
string |
|
displayName |
string |
This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider. |
id |
string |
|
imageUrl |
string |
|
inactive |
boolean |
|
isAadIdentity |
boolean |
|
isContainer |
boolean |
|
isDeletedInOrigin |
boolean |
|
profileUrl |
string |
|
uniqueName |
string |
|
url |
string |
This url is the full route to the source resource of this graph subject. |
ItemContent
Name | Type | Description |
---|---|---|
content |
string |
|
contentType |
ItemContentType
Name | Type | Description |
---|---|---|
base64Encoded |
string |
|
rawText |
string |
ReferenceLinks
The class to represent a collection of REST reference links.
Name | Type | Description |
---|---|---|
links |
object |
The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only. |
ResourceRef
Name | Type | Description |
---|---|---|
id |
string |
|
url |
string |
VersionControlChangeType
The type of change that was made to the item.
Name | Type | Description |
---|---|---|
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 |