Compartilhar via


Commits - Get Commits

Recuperar commits do git para um projeto

Os parâmetros que usam o prefixo searchCriteria em seu nome podem ser especificados sem ele como parâmetros de consulta, por exemplo, searchCriteria.$top -> $top

GET https://dev.azure.com/{organization}/{project}/_apis/git/repositories/{repositoryId}/commits?api-version=7.1-preview.1
GET https://dev.azure.com/{organization}/{project}/_apis/git/repositories/{repositoryId}/commits?searchCriteria.$skip={searchCriteria.$skip}&searchCriteria.$top={searchCriteria.$top}&searchCriteria.author={searchCriteria.author}&searchCriteria.compareVersion.version={searchCriteria.compareVersion.version}&searchCriteria.compareVersion.versionOptions={searchCriteria.compareVersion.versionOptions}&searchCriteria.compareVersion.versionType={searchCriteria.compareVersion.versionType}&searchCriteria.excludeDeletes={searchCriteria.excludeDeletes}&searchCriteria.fromCommitId={searchCriteria.fromCommitId}&searchCriteria.fromDate={searchCriteria.fromDate}&searchCriteria.historyMode={searchCriteria.historyMode}&searchCriteria.ids={searchCriteria.ids}&searchCriteria.includeLinks={searchCriteria.includeLinks}&searchCriteria.includePushData={searchCriteria.includePushData}&searchCriteria.includeUserImageUrl={searchCriteria.includeUserImageUrl}&searchCriteria.includeWorkItems={searchCriteria.includeWorkItems}&searchCriteria.itemPath={searchCriteria.itemPath}&searchCriteria.itemVersion.version={searchCriteria.itemVersion.version}&searchCriteria.itemVersion.versionOptions={searchCriteria.itemVersion.versionOptions}&searchCriteria.itemVersion.versionType={searchCriteria.itemVersion.versionType}&searchCriteria.showOldestCommitsFirst={searchCriteria.showOldestCommitsFirst}&searchCriteria.toCommitId={searchCriteria.toCommitId}&searchCriteria.toDate={searchCriteria.toDate}&searchCriteria.user={searchCriteria.user}&api-version=7.1-preview.1

Parâmetros de URI

Nome Em Obrigatório Tipo Description
organization
path True

string

O nome da organização do Azure DevOps.

repositoryId
path True

string

O ID ou o nome amigável do repositório. Para usar o nome amigável, projectId também deve ser especificado.

project
path

string

ID do projeto ou nome do projeto

api-version
query True

string

Versão da API a ser usada. Isso deve ser definido como '7.1-preview.1' para usar essa versão da API.

searchCriteria.$skip
query

integer

int32

Número de entradas a serem ignoradas

searchCriteria.$top
query

integer

int32

Número máximo de entradas a serem recuperadas

searchCriteria.author
query

string

Alias ou nome de exibição do autor

searchCriteria.compareVersion.version
query

string

Identificador de cadeia de caracteres de versão (nome da marca/branch, SHA1 do commit)

searchCriteria.compareVersion.versionOptions
query

GitVersionOptions

Opções de versão – especifique modificadores adicionais para a versão (por exemplo, Anterior)

searchCriteria.compareVersion.versionType
query

GitVersionType

Tipo de versão (branch, marca ou confirmação). Determina como a ID é interpretada

searchCriteria.excludeDeletes
query

boolean

Aplica-se somente quando um itemPath é especificado. Isso determina se as entradas de exclusão do caminho especificado devem ser excluídas.

searchCriteria.fromCommitId
query

string

Se fornecido, um limite inferior para filtragem confirma em ordem alfabética

searchCriteria.fromDate
query

string

Se fornecido, inclua somente entradas de histórico criadas após essa data (cadeia de caracteres)

searchCriteria.historyMode
query

GitHistoryMode

Qual modo de histórico do Git deve ser usado. Isso só se aplica aos critérios de pesquisa quando IDs = nulo e um itemPath é especificado.

searchCriteria.ids
query

string[]

Se fornecido, especifica as IDs de confirmação exatas dos commits a serem buscados. Pode não ser combinado com outros parâmetros.

searchCriteria.includeLinks
query

boolean

Se o campo de _links deve ser incluído nas referências superficiais

searchCriteria.includePushData
query

boolean

Se as informações de envio por push devem ser incluídas

searchCriteria.includeUserImageUrl
query

boolean

Se a URL da imagem deve ser incluída para committers e autores

searchCriteria.includeWorkItems
query

boolean

Se os itens de trabalho vinculados devem ser incluídos

searchCriteria.itemPath
query

string

Caminho do item a ser pesquisado em

searchCriteria.itemVersion.version
query

string

Identificador de cadeia de caracteres de versão (nome da marca/branch, SHA1 do commit)

searchCriteria.itemVersion.versionOptions
query

GitVersionOptions

Opções de versão – especifique modificadores adicionais para a versão (por exemplo, Anterior)

searchCriteria.itemVersion.versionType
query

GitVersionType

Tipo de versão (branch, marca ou confirmação). Determina como a ID é interpretada

searchCriteria.showOldestCommitsFirst
query

boolean

Se habilitada, essa opção ignorará os parâmetros itemVersion e compareVersion

searchCriteria.toCommitId
query

string

Se fornecido, um limite superior para filtragem confirma em ordem alfabética

searchCriteria.toDate
query

string

Se fornecido, inclua somente entradas de histórico criadas antes dessa data (cadeia de caracteres)

searchCriteria.user
query

string

Alias ou nome de exibição do committer

Respostas

Nome Tipo Description
200 OK

GitCommitRef[]

operação bem-sucedida

Segurança

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

Nome Description
vso.code Concede a capacidade de ler código-fonte e metadados sobre commits, conjuntos de alterações, branches e outros artefatos de controle de versão. Também concede a capacidade de pesquisar código e ser notificado sobre eventos de controle de versão por meio de ganchos de serviço.

Exemplos

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=7.1-preview.1

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=7.1-preview.1

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=7.1-preview.1

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.fromDate=6/14/2018 12:00:00 AM&searchCriteria.toDate=6/16/2018 12:00:00 AM&api-version=7.1-preview.1

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=7.1-preview.1

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=7.1-preview.1

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=7.1-preview.1

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=7.1-preview.1

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.compareVersion.version=master&searchCriteria.itemPath=/README.md&searchCriteria.itemVersion.version=4fa42e1a7b0215cc70cd4e927cb70c422123af84&searchCriteria.itemVersion.versionType=commit&api-version=7.1-preview.1

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

Definições

Nome Description
ChangeCountDictionary
GitChange
GitCommitRef

Fornece propriedades que descrevem um commit do Git e metadados associados.

GitHistoryMode

Qual modo de histórico do Git deve ser usado. Isso só se aplica aos critérios de pesquisa quando Ids = null e um itemPath é especificado.

GitPushRef
GitStatus

Essa classe contém os metadados de um serviço/extensão postando um status.

GitStatusContext

Contexto de status que identifica exclusivamente o status.

GitStatusState

Estado do status.

GitTemplate
GitUserDate

Informações do usuário e data das operações do Git.

GitVersionOptions

Opções de versão – especificar modificadores adicionais para a versão (por exemplo, Anterior)

GitVersionType

Tipo de versão (branch, marca ou commit). Determina como a ID é interpretada

IdentityRef
ItemContent
ItemContentType
ReferenceLinks

A classe para representar uma coleção de links de referência REST.

ResourceRef
VersionControlChangeType

O tipo de alteração feita no item.

ChangeCountDictionary

GitChange

Nome Tipo Description
changeId

integer

ID da alteração no grupo de alterações.

changeType

VersionControlChangeType

O tipo de alteração feita no item.

item

string

Versão atual.

newContent

ItemContent

Conteúdo do item após a alteração.

newContentTemplate

GitTemplate

Novo modelo de conteúdo a ser usado ao enviar novas alterações por push.

originalPath

string

Caminho original do item se diferente do caminho atual.

sourceServerItem

string

Caminho do item no servidor.

url

string

URL para recuperar o item.

GitCommitRef

Fornece propriedades que descrevem um commit do Git e metadados associados.

Nome Tipo Description
_links

ReferenceLinks

Uma coleção de links de referência REST relacionados.

author

GitUserDate

Autor do commit.

changeCounts

ChangeCountDictionary

Contagens dos tipos de alterações (edições, exclusões etc.) incluídas no commit.

changes

GitChange[]

Uma enumeração das alterações incluídas no commit.

comment

string

Comentário ou mensagem do commit.

commentTruncated

boolean

Indica se o comentário está truncado da mensagem de comentário de confirmação completa do Git.

commitId

string

ID (SHA-1) do commit.

commitTooManyChanges

boolean

Indica que commit contém muitas alterações a serem exibidas

committer

GitUserDate

Committer do commit.

parents

string[]

Uma enumeração das IDs de commit pai para esse commit.

push

GitPushRef

O push associado a esse commit.

remoteUrl

string

Caminho da URL remota para o commit.

statuses

GitStatus[]

Uma lista de status metadados de serviços e extensões que podem associar informações adicionais ao commit.

url

string

URL REST para esse recurso.

workItems

ResourceRef[]

Uma lista de workitems associados a esse commit.

GitHistoryMode

Qual modo de histórico do Git deve ser usado. Isso só se aplica aos critérios de pesquisa quando Ids = null e um itemPath é especificado.

Nome Tipo Description
firstParent

string

O modo de histórico usado por git log --first-parent

fullHistory

string

O modo de histórico usado por git log --full-history

fullHistorySimplifyMerges

string

O modo de histórico usado por git log --full-history --simplify-merges

simplifiedHistory

string

O modo de histórico usado por git log. Esse é o padrão.

GitPushRef

Nome Tipo Description
_links

ReferenceLinks

A classe para representar uma coleção de links de referência REST.

date

string

pushId

integer

pushedBy

IdentityRef

url

string

GitStatus

Essa classe contém os metadados de um serviço/extensão postando um status.

Nome Tipo Description
_links

ReferenceLinks

Links de referência.

context

GitStatusContext

Contexto do status.

createdBy

IdentityRef

Identidade que criou o status.

creationDate

string

Data e hora da criação do status.

description

string

Descrição do status. Normalmente descreve o estado atual do status.

id

integer

Identificador de status.

state

GitStatusState

Estado do status.

targetUrl

string

URL com status detalhes.

updatedDate

string

Data e hora da última atualização do status.

GitStatusContext

Contexto de status que identifica exclusivamente o status.

Nome Tipo Description
genre

string

Gênero do status. Normalmente, o nome do serviço/ferramenta que gera o status pode estar vazio.

name

string

O identificador de nome do status não pode ser nulo ou vazio.

GitStatusState

Estado do status.

Nome Tipo Description
error

string

Status com um erro.

failed

string

Falha no status.

notApplicable

string

O status não é aplicável ao objeto de destino.

notSet

string

Estado de status não definido. Estado padrão.

pending

string

Status pendente.

succeeded

string

Status bem-sucedido.

GitTemplate

Nome Tipo Description
name

string

Nome do modelo

type

string

Tipo do modelo

GitUserDate

Informações do usuário e data das operações do Git.

Nome Tipo Description
date

string

Data da operação do Git.

email

string

Email endereço do usuário que está executando a operação git.

imageUrl

string

Url para o avatar do usuário.

name

string

Nome do usuário que está executando a operação git.

GitVersionOptions

Opções de versão – especificar modificadores adicionais para a versão (por exemplo, Anterior)

Nome Tipo Description
firstParent

string

Primeiro pai do commit (HEAD^)

none

string

Não especificado

previousChange

string

Confirmar esse item alterado antes da versão atual

GitVersionType

Tipo de versão (branch, marca ou commit). Determina como a ID é interpretada

Nome Tipo Description
branch

string

Interpretar a versão como um nome de branch

commit

string

Interpretar a versão como um ID do commit (SHA1)

tag

string

Interpretar a versão como um nome de marca

IdentityRef

Nome Tipo Description
_links

ReferenceLinks

Esse campo contém zero ou mais links interessantes sobre o assunto do grafo. Esses links podem ser invocados para obter relações adicionais ou informações mais detalhadas sobre esse assunto do grafo.

descriptor

string

O descritor é a principal maneira de referenciar o assunto do grafo enquanto o sistema está em execução. Esse campo identificará exclusivamente o mesmo assunto de grafo entre contas e organizações.

directoryAlias

string

Preterido – pode ser recuperado consultando o usuário do Graph referenciado na entrada "self" do dicionário IdentityRef "_links"

displayName

string

Esse é o nome de exibição não exclusivo do assunto do grafo. Para alterar esse campo, você deve alterar seu valor no provedor de origem.

id

string

imageUrl

string

Preterido – Disponível na entrada "avatar" do dicionário IdentityRef "_links"

inactive

boolean

Preterido – pode ser recuperado consultando o estado de associação do Graph referenciado na entrada "membershipState" do dicionário "_links" do GraphUser

isAadIdentity

boolean

Preterido – pode ser inferido do tipo de assunto do descritor (Descriptor.IsAadUserType/Descriptor.IsAadGroupType)

isContainer

boolean

Preterido – pode ser inferido do tipo de assunto do descritor (Descriptor.IsGroupType)

isDeletedInOrigin

boolean

profileUrl

string

Preterido – não em uso na maioria das implementações preexistir de ToIdentityRef

uniqueName

string

Preterido – use Domain+PrincipalName em vez disso

url

string

Essa URL é a rota completa para o recurso de origem desta entidade de grafo.

ItemContent

Nome Tipo Description
content

string

contentType

ItemContentType

ItemContentType

Nome Tipo Description
base64Encoded

string

rawText

string

A classe para representar uma coleção de links de referência REST.

Nome Tipo Description
links

object

A exibição somente leitura dos links. Como os links de referência são somente leitura, só queremos expô-los como somente leitura.

ResourceRef

Nome Tipo Description
id

string

url

string

VersionControlChangeType

O tipo de alteração feita no item.

Nome Tipo 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