Sdílet prostřednictvím


Commits - Get Commits

Načtení potvrzení gitu pro projekt

Parametry, které ve svém názvu používají předponu searchCriteria, lze bez něj zadat jako parametry dotazu, například 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

Parametry identifikátoru URI

Name V Vyžadováno Typ Description
organization
path True

string

Název organizace Azure DevOps.

repositoryId
path True

string

ID nebo popisný název úložiště. Pokud chcete použít popisný název, musí být zadáno také projectId.

project
path

string

ID projektu nebo název projektu

api-version
query True

string

Verze rozhraní API, která se má použít. Aby se tato verze rozhraní API používala, měla by být nastavená na hodnotu 5.0.

searchCriteria.$skip
query

integer

int32

Počet položek, které se mají přeskočit

searchCriteria.$top
query

integer

int32

Maximální počet položek, které se mají načíst

searchCriteria.author
query

string

Alias nebo zobrazované jméno autora

searchCriteria.compareVersion.version
query

string

Identifikátor řetězce verze (název značky nebo větve, SHA1 potvrzení)

searchCriteria.compareVersion.versionOptions
query

GitVersionOptions

Možnosti verze – Zadejte další modifikátory pro verzi (např. Předchozí).

searchCriteria.compareVersion.versionType
query

GitVersionType

Typ verze (větev, značka nebo potvrzení). Určuje, jak se ID interpretuje.

searchCriteria.excludeDeletes
query

boolean

Platí pouze v případě, že je zadána itemPath. Tím určíte, zda se mají vyloučit položky odstranění zadané cesty.

searchCriteria.fromCommitId
query

string

Pokud je zadaný, dolní mez pro filtrování potvrzení abecedně

searchCriteria.fromDate
query

string

Pokud je zadaný, zahrňte pouze položky historie vytvořené po tomto datu (řetězec).

searchCriteria.historyMode
query

GitHistoryMode

Jaký režim historie Gitu byste měli použít. To platí pouze pro kritéria hledání, pokud je zadána ids = null a itemPath.

searchCriteria.ids
query

string[]

Pokud je zadaný, určuje přesná ID potvrzení potvrzení, která se mají načíst. Nelze kombinovat s jinými parametry.

searchCriteria.includeLinks
query

boolean

Zda zahrnout pole _links na mělké odkazy

searchCriteria.includePushData
query

boolean

Zda se mají zahrnout nabízené informace

searchCriteria.includeUserImageUrl
query

boolean

Zda se má zahrnout adresa URL obrázku pro autory a autory

searchCriteria.includeWorkItems
query

boolean

Zda se mají zahrnout propojené pracovní položky

searchCriteria.itemPath
query

string

Cesta položky, ve které se má hledat

searchCriteria.itemVersion.version
query

string

Identifikátor řetězce verze (název značky nebo větve, SHA1 potvrzení)

searchCriteria.itemVersion.versionOptions
query

GitVersionOptions

Možnosti verze – Zadejte další modifikátory pro verzi (např. Předchozí).

searchCriteria.itemVersion.versionType
query

GitVersionType

Typ verze (větev, značka nebo potvrzení). Určuje, jak se ID interpretuje.

searchCriteria.toCommitId
query

string

Pokud je zadaný, horní mez pro filtrování potvrzení abecedně

searchCriteria.toDate
query

string

Pokud je zadaný, zahrňte pouze položky historie vytvořené před tímto datem (řetězec).

searchCriteria.user
query

string

Alias nebo zobrazovaný název committeru

Odpovědi

Name Typ Description
200 OK

GitCommitRef[]

úspěšná operace

Zabezpečení

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 Umožňuje číst zdrojový kód a metadata o potvrzeních, sadách změn, větvích a dalších artefaktech správy verzí. Umožňuje také prohledávat kód a dostávat oznámení o událostech správy verzí prostřednictvím služby Hooks.

Příklady

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"
    }
  ]
}

Definice

Name Description
ChangeCountDictionary
GitChange
GitCommitRef

Poskytuje vlastnosti, které popisují potvrzení Gitu a přidružená metadata.

GitHistoryMode

Jaký režim historie Gitu byste měli použít. To platí pouze pro kritéria hledání, pokud je zadána ids = null a itemPath.

GitPushRef
GitStatus

Tato třída obsahuje metadata služby nebo rozšíření, které publikuje stav.

GitStatusContext

Kontext stavu, který jednoznačně identifikuje stav.

GitStatusState

Stav stavu.

GitTemplate
GitUserDate

Informace o uživateli a datum pro operace Gitu

GitVersionOptions

Možnosti verze – Zadejte další modifikátory verze (např. Předchozí).

GitVersionType

Typ verze (větev, značka nebo potvrzení). Určuje, jak se ID interpretuje.

IdentityRef
ItemContent
ItemContentType
ReferenceLinks

Třída představující kolekci odkazů REST.

ResourceRef
VersionControlChangeType

Typ změny, která byla provedena u položky.

ChangeCountDictionary

GitChange

Name Typ Description
changeId

integer

ID změny v rámci skupiny změn

changeType

VersionControlChangeType

Typ změny, která byla provedena u položky.

item

string

Aktuální verze.

newContent

ItemContent

Obsah položky po změně.

newContentTemplate

GitTemplate

Nová šablona obsahu, která se má použít při vkládání nových změn.

originalPath

string

Původní cesta k položce, pokud se liší od aktuální cesty.

sourceServerItem

string

Cesta k položce na serveru.

url

string

Adresa URL pro načtení položky

GitCommitRef

Poskytuje vlastnosti, které popisují potvrzení Gitu a přidružená metadata.

Name Typ Description
_links

ReferenceLinks

Kolekce souvisejících odkazů rest.

author

GitUserDate

Autor potvrzení.

changeCounts

ChangeCountDictionary

Počítá typy změn (úpravy, odstranění atd.), které jsou součástí potvrzení.

changes

GitChange[]

Výčet změn zahrnutých v potvrzení.

comment

string

Komentář nebo zpráva potvrzení

commentTruncated

boolean

Označuje, jestli je komentář zkrácený od úplné zprávy o potvrzení Gitu.

commitId

string

ID (SHA-1) potvrzení.

committer

GitUserDate

Committer potvrzení.

parents

string[]

Výčet ID nadřazeného potvrzení pro toto potvrzení.

push

GitPushRef

Nabízené oznámení přidružené k tomuto potvrzení.

remoteUrl

string

Vzdálená cesta URL k potvrzení.

statuses

GitStatus[]

Seznam metadat stavu ze služeb a rozšíření, která můžou k potvrzení přidružit další informace.

url

string

Adresa URL REST pro tento prostředek.

workItems

ResourceRef[]

Seznam pracovních položek přidružených k tomuto potvrzení.

GitHistoryMode

Jaký režim historie Gitu byste měli použít. To platí pouze pro kritéria hledání, pokud je zadána ids = null a itemPath.

Name Typ Description
firstParent

string

Režim historie, který používá git log --first-parent

fullHistory

string

Režim historie, který používá git log --full-history

fullHistorySimplifyMerges

string

Režim historie, který používá git log --full-history --simplify-merges

simplifiedHistory

string

Režim historie používaný nástrojem git log. Tato možnost je výchozí.

GitPushRef

Name Typ Description
_links

ReferenceLinks

Třída představující kolekci odkazů REST.

date

string

pushId

integer

pushedBy

IdentityRef

url

string

GitStatus

Tato třída obsahuje metadata služby nebo rozšíření, které publikuje stav.

Name Typ Description
_links

ReferenceLinks

Odkazy.

context

GitStatusContext

Kontext stavu.

createdBy

IdentityRef

Identita, která vytvořila stav.

creationDate

string

Datum a čas vytvoření stavu.

description

string

Popis stavu. Obvykle popisuje aktuální stav stavu.

id

integer

Identifikátor stavu.

state

GitStatusState

Stav stavu.

targetUrl

string

Adresa URL s podrobnostmi o stavu

updatedDate

string

Datum a čas poslední aktualizace stavu.

GitStatusContext

Kontext stavu, který jednoznačně identifikuje stav.

Name Typ Description
genre

string

Žánr stavu. Název služby nebo nástroje, který generuje stav, může být obvykle prázdný.

name

string

Identifikátor názvu stavu nesmí být null nebo prázdný.

GitStatusState

Stav stavu.

Name Typ Description
error

string

Stav s chybou.

failed

string

Stav selhal.

notApplicable

string

Stav se nevztahuje na cílový objekt.

notSet

string

Stav není nastavený. Výchozí stav.

pending

string

Stav čeká na vyřízení.

succeeded

string

Stav byl úspěšný.

GitTemplate

Name Typ Description
name

string

Název šablony

type

string

Typ šablony

GitUserDate

Informace o uživateli a datum pro operace Gitu

Name Typ Description
date

string

Datum operace Git.

email

string

Email adresu uživatele provádějícího operaci Git.

imageUrl

string

Adresa URL avatara uživatele

name

string

Jméno uživatele, který provádí operaci Git.

GitVersionOptions

Možnosti verze – Zadejte další modifikátory verze (např. Předchozí).

Name Typ Description
firstParent

string

První nadřazený prvek potvrzení (HEAD^)

none

string

Nezadá se

previousChange

string

Potvrzení změněné položky před aktuální verzí

GitVersionType

Typ verze (větev, značka nebo potvrzení). Určuje, jak se ID interpretuje.

Name Typ Description
branch

string

Interpretace verze jako názvu větve

commit

string

Interpretace verze jako ID potvrzení (SHA1)

tag

string

Interpretace verze jako názvu značky

IdentityRef

Name Typ Description
_links

ReferenceLinks

Toto pole obsahuje nula nebo více zajímavých odkazů o předmětu grafu. Tyto odkazy mohou být vyvolány za účelem získání dalších relací nebo podrobnějších informací o tomto předmětu grafu.

descriptor

string

Popisovač je primárním způsobem, jak odkazovat na předmět grafu, když je systém spuštěný. Toto pole jednoznačně identifikuje stejný předmět grafu napříč účty i organizacemi.

directoryAlias

string

displayName

string

Toto je jedinečný zobrazovaný název předmětu grafu. Pokud chcete toto pole změnit, musíte změnit jeho hodnotu ve zdrojovém poskytovateli.

id

string

imageUrl

string

inactive

boolean

isAadIdentity

boolean

isContainer

boolean

isDeletedInOrigin

boolean

profileUrl

string

uniqueName

string

url

string

Tato adresa URL je úplná trasa ke zdrojovému prostředku tohoto předmětu grafu.

ItemContent

Name Typ Description
content

string

contentType

ItemContentType

ItemContentType

Name Typ Description
base64Encoded

string

rawText

string

Třída představující kolekci odkazů REST.

Name Typ Description
links

object

Zobrazení odkazů jen pro čtení. Vzhledem k tomu, že odkazy jsou jen pro čtení, chceme je zveřejnit jenom jako jen pro čtení.

ResourceRef

Name Typ Description
id

string

url

string

VersionControlChangeType

Typ změny, která byla provedena u položky.

Name Typ 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