Compartir a través de


Commits - Get Commits

Recuperación de confirmaciones de Git para un proyecto

Los parámetros que usan el prefijo searchCriteria en su nombre se pueden especificar sin él como parámetros de consulta, por ejemplo, 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 identificador URI

Nombre En Requerido Tipo Description
organization
path True

string

El nombre de la organización de Azure DevOps.

repositoryId
path True

string

Identificador o nombre descriptivo del repositorio. Para usar el nombre descriptivo, también se debe especificar projectId.

project
path

string

Id. de proyecto o nombre del proyecto

api-version
query True

string

Versión de la API que se va a usar. Debe establecerse en "7.1-preview.1" para usar esta versión de la API.

searchCriteria.$skip
query

integer

int32

Número de entradas que se van a omitir

searchCriteria.$top
query

integer

int32

Número máximo de entradas que se van a recuperar

searchCriteria.author
query

string

Alias o nombre para mostrar del autor

searchCriteria.compareVersion.version
query

string

Identificador de cadena de versión (nombre de etiqueta/rama, SHA1 de confirmación)

searchCriteria.compareVersion.versionOptions
query

GitVersionOptions

Opciones de versión: especifique modificadores adicionales para la versión (por ejemplo, Anterior)

searchCriteria.compareVersion.versionType
query

GitVersionType

Tipo de versión (rama, etiqueta o confirmación). Determina cómo se interpreta id.

searchCriteria.excludeDeletes
query

boolean

Solo se aplica cuando se especifica un itemPath. Esto determina si se van a excluir las entradas de eliminación de la ruta de acceso especificada.

searchCriteria.fromCommitId
query

string

Si se proporciona, un límite inferior para filtrar confirmaciones alfabéticamente

searchCriteria.fromDate
query

string

Si se proporciona, incluya solo las entradas del historial creadas después de esta fecha (cadena)

searchCriteria.historyMode
query

GitHistoryMode

Qué modo de historial de Git se debe usar. Esto solo se aplica a los criterios de búsqueda cuando se especifica Ids = null y itemPath.

searchCriteria.ids
query

string[]

Si se proporciona, especifica los identificadores de confirmación exactos de las confirmaciones que se van a capturar. No se puede combinar con otros parámetros.

searchCriteria.includeLinks
query

boolean

Si se debe incluir el campo _links en las referencias poco profundas

searchCriteria.includePushData
query

boolean

Si se debe incluir la información de inserción

searchCriteria.includeUserImageUrl
query

boolean

Si se debe incluir la dirección URL de la imagen para los autores y los confirmadores

searchCriteria.includeWorkItems
query

boolean

Si se deben incluir elementos de trabajo vinculados

searchCriteria.itemPath
query

string

Ruta de acceso del elemento en la que se va a buscar

searchCriteria.itemVersion.version
query

string

Identificador de cadena de versión (nombre de etiqueta/rama, SHA1 de confirmación)

searchCriteria.itemVersion.versionOptions
query

GitVersionOptions

Opciones de versión: especifique modificadores adicionales para la versión (por ejemplo, Anterior)

searchCriteria.itemVersion.versionType
query

GitVersionType

Tipo de versión (rama, etiqueta o confirmación). Determina cómo se interpreta id.

searchCriteria.showOldestCommitsFirst
query

boolean

Si está habilitada, esta opción omitirá los parámetros itemVersion y compareVersion.

searchCriteria.toCommitId
query

string

Si se proporciona, un límite superior para filtrar confirma alfabéticamente las confirmaciones

searchCriteria.toDate
query

string

Si se proporciona, incluya solo las entradas del historial creadas antes de esta fecha (cadena)

searchCriteria.user
query

string

Alias o nombre para mostrar del committer

Respuestas

Nombre Tipo Description
200 OK

GitCommitRef[]

operación correcta

Seguridad

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

Nombre Description
vso.code Concede la capacidad de leer el código fuente y los metadatos sobre confirmaciones, conjuntos de cambios, ramas y otros artefactos de control de versiones. También concede la capacidad de buscar código y recibir notificaciones sobre los eventos de control de versiones a través de enlaces de servicio.

Ejemplos

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

Definiciones

Nombre Description
ChangeCountDictionary
GitChange
GitCommitRef

Proporciona propiedades que describen una confirmación de Git y los metadatos asociados.

GitHistoryMode

Qué modo de historial de Git se debe usar. Esto solo se aplica a los criterios de búsqueda cuando se especifica Ids = null y itemPath.

GitPushRef
GitStatus

Esta clase contiene los metadatos de un servicio o extensión que registra un estado.

GitStatusContext

Contexto de estado que identifica de forma única el estado.

GitStatusState

Estado del estado.

GitTemplate
GitUserDate

Información del usuario y fecha de las operaciones de Git.

GitVersionOptions

Opciones de versión: especifique modificadores adicionales para la versión (por ejemplo, Anterior)

GitVersionType

Tipo de versión (rama, etiqueta o confirmación). Determina cómo se interpreta id.

IdentityRef
ItemContent
ItemContentType
ReferenceLinks

Clase que representa una colección de vínculos de referencia de REST.

ResourceRef
VersionControlChangeType

Tipo de cambio que se realizó en el elemento.

ChangeCountDictionary

GitChange

Nombre Tipo Description
changeId

integer

Identificador del cambio dentro del grupo de cambios.

changeType

VersionControlChangeType

Tipo de cambio que se realizó en el elemento.

item

string

Versión actual.

newContent

ItemContent

Contenido del elemento después del cambio.

newContentTemplate

GitTemplate

Nueva plantilla de contenido que se usará al insertar nuevos cambios.

originalPath

string

Ruta de acceso original del elemento si es diferente de la ruta de acceso actual.

sourceServerItem

string

Ruta de acceso del elemento en el servidor.

url

string

Dirección URL para recuperar el elemento.

GitCommitRef

Proporciona propiedades que describen una confirmación de Git y los metadatos asociados.

Nombre Tipo Description
_links

ReferenceLinks

Colección de vínculos de referencia de REST relacionados.

author

GitUserDate

Autor de la confirmación.

changeCounts

ChangeCountDictionary

Recuentos de los tipos de cambios (ediciones, eliminaciones, etc.) incluidos con la confirmación.

changes

GitChange[]

Enumeración de los cambios incluidos con la confirmación.

comment

string

Comentario o mensaje de la confirmación.

commentTruncated

boolean

Indica si el comentario se trunca desde el mensaje completo del comentario de confirmación de Git.

commitId

string

Id. (SHA-1) de la confirmación.

commitTooManyChanges

boolean

Indica que la confirmación contiene demasiados cambios que se mostrarán.

committer

GitUserDate

Committer de la confirmación.

parents

string[]

Enumeración de los identificadores de confirmación primarios para esta confirmación.

push

GitPushRef

Inserción asociada a esta confirmación.

remoteUrl

string

Ruta de acceso de dirección URL remota a la confirmación.

statuses

GitStatus[]

Lista de metadatos de estado de servicios y extensiones que pueden asociar información adicional a la confirmación.

url

string

Dirección URL de REST para este recurso.

workItems

ResourceRef[]

Lista de elementos de trabajo asociados a esta confirmación.

GitHistoryMode

Qué modo de historial de Git se debe usar. Esto solo se aplica a los criterios de búsqueda cuando se especifica Ids = null y itemPath.

Nombre Tipo Description
firstParent

string

Modo de historial usado por git log --first-parent

fullHistory

string

Modo de historial usado por git log --full-history

fullHistorySimplifyMerges

string

Modo de historial usado por git log --full-history --simplify-merges

simplifiedHistory

string

Modo de historial utilizado por git log. Este es el valor predeterminado.

GitPushRef

Nombre Tipo Description
_links

ReferenceLinks

Clase que representa una colección de vínculos de referencia de REST.

date

string

pushId

integer

pushedBy

IdentityRef

url

string

GitStatus

Esta clase contiene los metadatos de un servicio o extensión que registra un estado.

Nombre Tipo Description
_links

ReferenceLinks

Vínculos de referencia.

context

GitStatusContext

Contexto del estado.

createdBy

IdentityRef

Identidad que creó el estado.

creationDate

string

Fecha y hora de creación del estado.

description

string

Descripción del estado. Normalmente se describe el estado actual del estado.

id

integer

Identificador de estado.

state

GitStatusState

Estado del estado.

targetUrl

string

Dirección URL con detalles de estado.

updatedDate

string

Fecha y hora de la última actualización del estado.

GitStatusContext

Contexto de estado que identifica de forma única el estado.

Nombre Tipo Description
genre

string

Género del estado. Normalmente, el nombre del servicio o la herramienta que genera el estado puede estar vacío.

name

string

El identificador de nombre del estado no puede ser nulo ni estar vacío.

GitStatusState

Estado del estado.

Nombre Tipo Description
error

string

Estado con un error.

failed

string

Error de estado.

notApplicable

string

El estado no es aplicable al objeto de destino.

notSet

string

Estado de estado no establecido. Estado predeterminado.

pending

string

Estado pendiente.

succeeded

string

El estado se realizó correctamente.

GitTemplate

Nombre Tipo Description
name

string

Nombre de la plantilla

type

string

Tipo de la plantilla

GitUserDate

Información del usuario y fecha de las operaciones de Git.

Nombre Tipo Description
date

string

Fecha de la operación de Git.

email

string

Email dirección del usuario que realiza la operación de Git.

imageUrl

string

Dirección URL del avatar del usuario.

name

string

Nombre del usuario que realiza la operación de Git.

GitVersionOptions

Opciones de versión: especifique modificadores adicionales para la versión (por ejemplo, Anterior)

Nombre Tipo Description
firstParent

string

Primer elemento primario de confirmación (HEAD^)

none

string

Sin especificar

previousChange

string

Confirmar que ha cambiado el elemento antes de la versión actual

GitVersionType

Tipo de versión (rama, etiqueta o confirmación). Determina cómo se interpreta id.

Nombre Tipo Description
branch

string

Interpretar la versión como un nombre de rama

commit

string

Interpretar la versión como un identificador de confirmación (SHA1)

tag

string

Interpretar la versión como un nombre de etiqueta

IdentityRef

Nombre Tipo Description
_links

ReferenceLinks

Este campo contiene cero o más vínculos interesantes sobre el tema del grafo. Estos vínculos se pueden invocar para obtener relaciones adicionales o información más detallada sobre este tema del grafo.

descriptor

string

El descriptor es la forma principal de hacer referencia al asunto del grafo mientras se ejecuta el sistema. Este campo identificará de forma única el mismo asunto del grafo en cuentas y organizaciones.

directoryAlias

string

En desuso: se puede recuperar consultando el usuario de Graph al que se hace referencia en la entrada "self" del diccionario IdentityRef "_links".

displayName

string

Este es el nombre para mostrar no único del asunto del grafo. Para cambiar este campo, debe modificar su valor en el proveedor de origen.

id

string

imageUrl

string

En desuso: disponible en la entrada "avatar" del diccionario "_links" de IdentityRef

inactive

boolean

En desuso: se puede recuperar consultando el estado de pertenencia de Graph al que se hace referencia en la entrada "membershipState" del diccionario GraphUser "_links".

isAadIdentity

boolean

En desuso: se puede deducir del tipo de asunto del descriptor (Descriptor.IsAadUserType/Descriptor.IsAadGroupType)

isContainer

boolean

En desuso: se puede deducir del tipo de sujeto del descriptor (Descriptor.IsGroupType)

isDeletedInOrigin

boolean

profileUrl

string

En desuso: no en uso en la mayoría de las implementaciones preexistentes de ToIdentityRef

uniqueName

string

En desuso: use Domain+PrincipalName en su lugar.

url

string

Esta dirección URL es la ruta completa al recurso de origen de este tema del grafo.

ItemContent

Nombre Tipo Description
content

string

contentType

ItemContentType

ItemContentType

Nombre Tipo Description
base64Encoded

string

rawText

string

Clase que representa una colección de vínculos de referencia de REST.

Nombre Tipo Description
links

object

Vista de solo lectura de los vínculos. Dado que los vínculos de referencia son de solo lectura, solo queremos exponerlos como de solo lectura.

ResourceRef

Nombre Tipo Description
id

string

url

string

VersionControlChangeType

Tipo de cambio que se realizó en el elemento.

Nombre 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