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=5.0
GET https://dev.azure.com/{organization}/{project}/_apis/git/repositories/{repositoryId}/commits?searchCriteria.historyMode={searchCriteria.historyMode}&searchCriteria.includePushData={searchCriteria.includePushData}&searchCriteria.includeUserImageUrl={searchCriteria.includeUserImageUrl}&searchCriteria.includeWorkItems={searchCriteria.includeWorkItems}&searchCriteria.includeLinks={searchCriteria.includeLinks}&searchCriteria.$top={searchCriteria.$top}&searchCriteria.$skip={searchCriteria.$skip}&searchCriteria.excludeDeletes={searchCriteria.excludeDeletes}&searchCriteria.itemPath={searchCriteria.itemPath}&searchCriteria.author={searchCriteria.author}&searchCriteria.user={searchCriteria.user}&searchCriteria.toCommitId={searchCriteria.toCommitId}&searchCriteria.fromCommitId={searchCriteria.fromCommitId}&searchCriteria.compareVersion.versionOptions={searchCriteria.compareVersion.versionOptions}&searchCriteria.compareVersion.version={searchCriteria.compareVersion.version}&searchCriteria.compareVersion.versionType={searchCriteria.compareVersion.versionType}&searchCriteria.itemVersion.versionOptions={searchCriteria.itemVersion.versionOptions}&searchCriteria.itemVersion.version={searchCriteria.itemVersion.version}&searchCriteria.itemVersion.versionType={searchCriteria.itemVersion.versionType}&searchCriteria.toDate={searchCriteria.toDate}&searchCriteria.fromDate={searchCriteria.fromDate}&searchCriteria.ids={searchCriteria.ids}&api-version=5.0
Parâmetros de URI
Nome | Em | Obrigatório | Tipo | Description |
---|---|---|---|---|
organization
|
path | True |
string |
O nome da organização do Azure DevOps. |
repository
|
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 '5.0' para usar essa versão da api. |
search
|
query |
integer int32 |
Número de entradas a serem ignoradas |
|
search
|
query |
integer int32 |
Número máximo de entradas a serem recuperadas |
|
search
|
query |
string |
Alias ou nome de exibição do autor |
|
search
|
query |
string |
Identificador de cadeia de caracteres de versão (nome da marca/branch, SHA1 de commit) |
|
search
|
query |
Opções de versão – especificar modificadores adicionais para a versão (por exemplo, Anterior) |
||
search
|
query |
Tipo de versão (branch, marca ou commit). Determina como a ID é interpretada |
||
search
|
query |
boolean |
Aplica-se somente quando um itemPath é especificado. Isso determina se as entradas de exclusão do caminho especificado devem ser excluídas. |
|
search
|
query |
string |
Se fornecido, um limite inferior para filtragem confirma em ordem alfabética |
|
search
|
query |
string |
Se fornecido, inclua somente entradas de histórico criadas após essa data (cadeia de caracteres) |
|
search
|
query |
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. |
||
search
|
query |
string[] |
Se fornecido, especifica as IDs de commit exatas dos commits a serem buscados. Pode não ser combinado com outros parâmetros. |
|
search
|
query |
boolean |
Se deve incluir o campo _links nas referências superficial |
|
search
|
query |
boolean |
Se deve incluir as informações de push |
|
search
|
query |
boolean |
Se deve incluir a URL de imagem para committers e autores |
|
search
|
query |
boolean |
Se deve incluir itens de trabalho vinculados |
|
search
|
query |
string |
Caminho do item a ser pesquisado em |
|
search
|
query |
string |
Identificador de cadeia de caracteres de versão (nome da marca/branch, SHA1 de commit) |
|
search
|
query |
Opções de versão – especificar modificadores adicionais para a versão (por exemplo, Anterior) |
||
search
|
query |
Tipo de versão (branch, marca ou commit). Determina como a ID é interpretada |
||
search
|
query |
string |
Se fornecido, um limite superior para filtragem confirma em ordem alfabética |
|
search
|
query |
string |
Se fornecido, inclua somente entradas de histórico criadas antes dessa data (cadeia de caracteres) |
|
search
|
query |
string |
Alias ou nome de exibição do committer |
Respostas
Nome | Tipo | Description |
---|---|---|
200 OK |
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=5.0
Sample Response
{
"count": 8,
"value": [
{
"commitId": "9991b4f66def4c0a9ad8f9f27043ece7eddcf1c7",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:53Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:53Z"
},
"comment": "Merged PR 2: Deleted README.md",
"commentTruncated": true,
"changeCounts": {
"Add": 0,
"Edit": 0,
"Delete": 1
},
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/9991b4f66def4c0a9ad8f9f27043ece7eddcf1c7",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/9991b4f66def4c0a9ad8f9f27043ece7eddcf1c7"
},
{
"commitId": "c771e2e3605c69d2435a6b34b28ac3db2c89efd2",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:38Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:38Z"
},
"comment": "Merge pull request 2 from b2 into master",
"changeCounts": {
"Add": 0,
"Edit": 0,
"Delete": 1
},
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/c771e2e3605c69d2435a6b34b28ac3db2c89efd2",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/c771e2e3605c69d2435a6b34b28ac3db2c89efd2"
},
{
"commitId": "20510720ffe1443d6ed3cb98ca340bc732ba04e5",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:32Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:32Z"
},
"comment": "Deleted README.md",
"changeCounts": {
"Add": 0,
"Edit": 0,
"Delete": 1
},
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/20510720ffe1443d6ed3cb98ca340bc732ba04e5",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/20510720ffe1443d6ed3cb98ca340bc732ba04e5"
},
{
"commitId": "4bac640ecfd017eeadfd282a8e31bcd8ab6d132b",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:17Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:17Z"
},
"comment": "Merged PR 1: Added file debug.log",
"commentTruncated": true,
"changeCounts": {
"Add": 1,
"Edit": 0,
"Delete": 0
},
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/4bac640ecfd017eeadfd282a8e31bcd8ab6d132b",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/4bac640ecfd017eeadfd282a8e31bcd8ab6d132b"
},
{
"commitId": "8921e81180bdf0e8b448be302698e425273e9df0",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:05:28Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:05:28Z"
},
"comment": "Merge pull request 1 from b1 into master",
"changeCounts": {
"Add": 1,
"Edit": 0,
"Delete": 0
},
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/8921e81180bdf0e8b448be302698e425273e9df0",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/8921e81180bdf0e8b448be302698e425273e9df0"
},
{
"commitId": "3104bd0b0accbc74278fe6880e53215f6b93a5cd",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:05:18Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:05:18Z"
},
"comment": "Added file debug.log",
"changeCounts": {
"Add": 1,
"Edit": 0,
"Delete": 0
},
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/3104bd0b0accbc74278fe6880e53215f6b93a5cd",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/3104bd0b0accbc74278fe6880e53215f6b93a5cd"
},
{
"commitId": "9c1e8b082e2c2f041bdd5db76d6bf5c11572524f",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:04:45Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:04:45Z"
},
"comment": "Added file file1.txt",
"changeCounts": {
"Add": 1,
"Edit": 0,
"Delete": 0
},
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/9c1e8b082e2c2f041bdd5db76d6bf5c11572524f",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/9c1e8b082e2c2f041bdd5db76d6bf5c11572524f"
},
{
"commitId": "4fa42e1a7b0215cc70cd4e927cb70c422123af84",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:04:22Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:04:22Z"
},
"comment": "Added README.md file",
"changeCounts": {
"Add": 1,
"Edit": 0,
"Delete": 0
},
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/4fa42e1a7b0215cc70cd4e927cb70c422123af84",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/4fa42e1a7b0215cc70cd4e927cb70c422123af84"
}
]
}
By author
Sample Request
GET https://dev.azure.com/fabrikam/_apis/git/repositories/{repositoryId}/commits?searchCriteria.author=Norman Paulk&api-version=5.0
Sample Response
{
"count": 8,
"value": [
{
"commitId": "9991b4f66def4c0a9ad8f9f27043ece7eddcf1c7",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:53Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:53Z"
},
"comment": "Merged PR 2: Deleted README.md",
"commentTruncated": true,
"changeCounts": {
"Add": 0,
"Edit": 0,
"Delete": 1
},
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/9991b4f66def4c0a9ad8f9f27043ece7eddcf1c7",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/9991b4f66def4c0a9ad8f9f27043ece7eddcf1c7"
},
{
"commitId": "c771e2e3605c69d2435a6b34b28ac3db2c89efd2",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:38Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:38Z"
},
"comment": "Merge pull request 2 from b2 into master",
"changeCounts": {
"Add": 0,
"Edit": 0,
"Delete": 1
},
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/c771e2e3605c69d2435a6b34b28ac3db2c89efd2",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/c771e2e3605c69d2435a6b34b28ac3db2c89efd2"
},
{
"commitId": "20510720ffe1443d6ed3cb98ca340bc732ba04e5",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:32Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:32Z"
},
"comment": "Deleted README.md",
"changeCounts": {
"Add": 0,
"Edit": 0,
"Delete": 1
},
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/20510720ffe1443d6ed3cb98ca340bc732ba04e5",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/20510720ffe1443d6ed3cb98ca340bc732ba04e5"
},
{
"commitId": "4bac640ecfd017eeadfd282a8e31bcd8ab6d132b",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:17Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:17Z"
},
"comment": "Merged PR 1: Added file debug.log",
"commentTruncated": true,
"changeCounts": {
"Add": 1,
"Edit": 0,
"Delete": 0
},
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/4bac640ecfd017eeadfd282a8e31bcd8ab6d132b",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/4bac640ecfd017eeadfd282a8e31bcd8ab6d132b"
},
{
"commitId": "8921e81180bdf0e8b448be302698e425273e9df0",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:05:28Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:05:28Z"
},
"comment": "Merge pull request 1 from b1 into master",
"changeCounts": {
"Add": 1,
"Edit": 0,
"Delete": 0
},
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/8921e81180bdf0e8b448be302698e425273e9df0",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/8921e81180bdf0e8b448be302698e425273e9df0"
},
{
"commitId": "3104bd0b0accbc74278fe6880e53215f6b93a5cd",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:05:18Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:05:18Z"
},
"comment": "Added file debug.log",
"changeCounts": {
"Add": 1,
"Edit": 0,
"Delete": 0
},
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/3104bd0b0accbc74278fe6880e53215f6b93a5cd",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/3104bd0b0accbc74278fe6880e53215f6b93a5cd"
},
{
"commitId": "9c1e8b082e2c2f041bdd5db76d6bf5c11572524f",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:04:45Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:04:45Z"
},
"comment": "Added file file1.txt",
"changeCounts": {
"Add": 1,
"Edit": 0,
"Delete": 0
},
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/9c1e8b082e2c2f041bdd5db76d6bf5c11572524f",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/9c1e8b082e2c2f041bdd5db76d6bf5c11572524f"
},
{
"commitId": "4fa42e1a7b0215cc70cd4e927cb70c422123af84",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:04:22Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:04:22Z"
},
"comment": "Added README.md file",
"changeCounts": {
"Add": 1,
"Edit": 0,
"Delete": 0
},
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/4fa42e1a7b0215cc70cd4e927cb70c422123af84",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/4fa42e1a7b0215cc70cd4e927cb70c422123af84"
}
]
}
By committer
Sample Request
GET https://dev.azure.com/fabrikam/_apis/git/repositories/{repositoryId}/commits?searchCriteria.user=shsamy@microsoft.com&api-version=5.0
Sample Response
{
"count": 8,
"value": [
{
"commitId": "9991b4f66def4c0a9ad8f9f27043ece7eddcf1c7",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:53Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:53Z"
},
"comment": "Merged PR 2: Deleted README.md",
"commentTruncated": true,
"changeCounts": {
"Add": 0,
"Edit": 0,
"Delete": 1
},
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/9991b4f66def4c0a9ad8f9f27043ece7eddcf1c7",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/9991b4f66def4c0a9ad8f9f27043ece7eddcf1c7"
},
{
"commitId": "c771e2e3605c69d2435a6b34b28ac3db2c89efd2",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:38Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:38Z"
},
"comment": "Merge pull request 2 from b2 into master",
"changeCounts": {
"Add": 0,
"Edit": 0,
"Delete": 1
},
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/c771e2e3605c69d2435a6b34b28ac3db2c89efd2",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/c771e2e3605c69d2435a6b34b28ac3db2c89efd2"
},
{
"commitId": "20510720ffe1443d6ed3cb98ca340bc732ba04e5",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:32Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:32Z"
},
"comment": "Deleted README.md",
"changeCounts": {
"Add": 0,
"Edit": 0,
"Delete": 1
},
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/20510720ffe1443d6ed3cb98ca340bc732ba04e5",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/20510720ffe1443d6ed3cb98ca340bc732ba04e5"
},
{
"commitId": "4bac640ecfd017eeadfd282a8e31bcd8ab6d132b",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:17Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:17Z"
},
"comment": "Merged PR 1: Added file debug.log",
"commentTruncated": true,
"changeCounts": {
"Add": 1,
"Edit": 0,
"Delete": 0
},
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/4bac640ecfd017eeadfd282a8e31bcd8ab6d132b",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/4bac640ecfd017eeadfd282a8e31bcd8ab6d132b"
},
{
"commitId": "8921e81180bdf0e8b448be302698e425273e9df0",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:05:28Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:05:28Z"
},
"comment": "Merge pull request 1 from b1 into master",
"changeCounts": {
"Add": 1,
"Edit": 0,
"Delete": 0
},
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/8921e81180bdf0e8b448be302698e425273e9df0",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/8921e81180bdf0e8b448be302698e425273e9df0"
},
{
"commitId": "3104bd0b0accbc74278fe6880e53215f6b93a5cd",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:05:18Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:05:18Z"
},
"comment": "Added file debug.log",
"changeCounts": {
"Add": 1,
"Edit": 0,
"Delete": 0
},
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/3104bd0b0accbc74278fe6880e53215f6b93a5cd",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/3104bd0b0accbc74278fe6880e53215f6b93a5cd"
},
{
"commitId": "9c1e8b082e2c2f041bdd5db76d6bf5c11572524f",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:04:45Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:04:45Z"
},
"comment": "Added file file1.txt",
"changeCounts": {
"Add": 1,
"Edit": 0,
"Delete": 0
},
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/9c1e8b082e2c2f041bdd5db76d6bf5c11572524f",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/9c1e8b082e2c2f041bdd5db76d6bf5c11572524f"
},
{
"commitId": "4fa42e1a7b0215cc70cd4e927cb70c422123af84",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:04:22Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:04:22Z"
},
"comment": "Added README.md file",
"changeCounts": {
"Add": 1,
"Edit": 0,
"Delete": 0
},
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/4fa42e1a7b0215cc70cd4e927cb70c422123af84",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/4fa42e1a7b0215cc70cd4e927cb70c422123af84"
}
]
}
In a date range
Sample Request
GET https://dev.azure.com/fabrikam/_apis/git/repositories/{repositoryId}/commits?searchCriteria.toDate=6/16/2018 12:00:00 AM&searchCriteria.fromDate=6/14/2018 12:00:00 AM&api-version=5.0
Sample Response
{
"count": 8,
"value": [
{
"commitId": "9991b4f66def4c0a9ad8f9f27043ece7eddcf1c7",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:53Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:53Z"
},
"comment": "Merged PR 2: Deleted README.md",
"commentTruncated": true,
"changeCounts": {
"Add": 0,
"Edit": 0,
"Delete": 1
},
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/9991b4f66def4c0a9ad8f9f27043ece7eddcf1c7",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/9991b4f66def4c0a9ad8f9f27043ece7eddcf1c7"
},
{
"commitId": "c771e2e3605c69d2435a6b34b28ac3db2c89efd2",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:38Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:38Z"
},
"comment": "Merge pull request 2 from b2 into master",
"changeCounts": {
"Add": 0,
"Edit": 0,
"Delete": 1
},
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/c771e2e3605c69d2435a6b34b28ac3db2c89efd2",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/c771e2e3605c69d2435a6b34b28ac3db2c89efd2"
},
{
"commitId": "20510720ffe1443d6ed3cb98ca340bc732ba04e5",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:32Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:32Z"
},
"comment": "Deleted README.md",
"changeCounts": {
"Add": 0,
"Edit": 0,
"Delete": 1
},
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/20510720ffe1443d6ed3cb98ca340bc732ba04e5",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/20510720ffe1443d6ed3cb98ca340bc732ba04e5"
},
{
"commitId": "4bac640ecfd017eeadfd282a8e31bcd8ab6d132b",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:17Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:17Z"
},
"comment": "Merged PR 1: Added file debug.log",
"commentTruncated": true,
"changeCounts": {
"Add": 1,
"Edit": 0,
"Delete": 0
},
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/4bac640ecfd017eeadfd282a8e31bcd8ab6d132b",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/4bac640ecfd017eeadfd282a8e31bcd8ab6d132b"
},
{
"commitId": "8921e81180bdf0e8b448be302698e425273e9df0",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:05:28Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:05:28Z"
},
"comment": "Merge pull request 1 from b1 into master",
"changeCounts": {
"Add": 1,
"Edit": 0,
"Delete": 0
},
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/8921e81180bdf0e8b448be302698e425273e9df0",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/8921e81180bdf0e8b448be302698e425273e9df0"
},
{
"commitId": "3104bd0b0accbc74278fe6880e53215f6b93a5cd",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:05:18Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:05:18Z"
},
"comment": "Added file debug.log",
"changeCounts": {
"Add": 1,
"Edit": 0,
"Delete": 0
},
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/3104bd0b0accbc74278fe6880e53215f6b93a5cd",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/3104bd0b0accbc74278fe6880e53215f6b93a5cd"
},
{
"commitId": "9c1e8b082e2c2f041bdd5db76d6bf5c11572524f",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:04:45Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:04:45Z"
},
"comment": "Added file file1.txt",
"changeCounts": {
"Add": 1,
"Edit": 0,
"Delete": 0
},
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/9c1e8b082e2c2f041bdd5db76d6bf5c11572524f",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/9c1e8b082e2c2f041bdd5db76d6bf5c11572524f"
},
{
"commitId": "4fa42e1a7b0215cc70cd4e927cb70c422123af84",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:04:22Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:04:22Z"
},
"comment": "Added README.md file",
"changeCounts": {
"Add": 1,
"Edit": 0,
"Delete": 0
},
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/4fa42e1a7b0215cc70cd4e927cb70c422123af84",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/4fa42e1a7b0215cc70cd4e927cb70c422123af84"
}
]
}
On a branch
Sample Request
GET https://dev.azure.com/fabrikam/_apis/git/repositories/{repositoryId}/commits?searchCriteria.itemVersion.version=master&api-version=5.0
Sample Response
link: <9991b4f66def4c0a9ad8f9f27043ece7eddcf1c7>;rel="startingCommitId"
{
"count": 6,
"value": [
{
"commitId": "9991b4f66def4c0a9ad8f9f27043ece7eddcf1c7",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:53Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:53Z"
},
"comment": "Merged PR 2: Deleted README.md",
"commentTruncated": true,
"changeCounts": {
"Add": 0,
"Edit": 0,
"Delete": 1
},
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/9991b4f66def4c0a9ad8f9f27043ece7eddcf1c7",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/9991b4f66def4c0a9ad8f9f27043ece7eddcf1c7"
},
{
"commitId": "20510720ffe1443d6ed3cb98ca340bc732ba04e5",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:32Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:32Z"
},
"comment": "Deleted README.md",
"changeCounts": {
"Add": 0,
"Edit": 0,
"Delete": 1
},
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/20510720ffe1443d6ed3cb98ca340bc732ba04e5",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/20510720ffe1443d6ed3cb98ca340bc732ba04e5"
},
{
"commitId": "4bac640ecfd017eeadfd282a8e31bcd8ab6d132b",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:17Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:17Z"
},
"comment": "Merged PR 1: Added file debug.log",
"commentTruncated": true,
"changeCounts": {
"Add": 1,
"Edit": 0,
"Delete": 0
},
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/4bac640ecfd017eeadfd282a8e31bcd8ab6d132b",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/4bac640ecfd017eeadfd282a8e31bcd8ab6d132b"
},
{
"commitId": "3104bd0b0accbc74278fe6880e53215f6b93a5cd",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:05:18Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:05:18Z"
},
"comment": "Added file debug.log",
"changeCounts": {
"Add": 1,
"Edit": 0,
"Delete": 0
},
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/3104bd0b0accbc74278fe6880e53215f6b93a5cd",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/3104bd0b0accbc74278fe6880e53215f6b93a5cd"
},
{
"commitId": "9c1e8b082e2c2f041bdd5db76d6bf5c11572524f",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:04:45Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:04:45Z"
},
"comment": "Added file file1.txt",
"changeCounts": {
"Add": 1,
"Edit": 0,
"Delete": 0
},
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/9c1e8b082e2c2f041bdd5db76d6bf5c11572524f",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/9c1e8b082e2c2f041bdd5db76d6bf5c11572524f"
},
{
"commitId": "4fa42e1a7b0215cc70cd4e927cb70c422123af84",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:04:22Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:04:22Z"
},
"comment": "Added README.md file",
"changeCounts": {
"Add": 1,
"Edit": 0,
"Delete": 0
},
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/4fa42e1a7b0215cc70cd4e927cb70c422123af84",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/4fa42e1a7b0215cc70cd4e927cb70c422123af84"
}
]
}
On a branch and in a path
Sample Request
GET https://dev.azure.com/fabrikam/_apis/git/repositories/{repositoryId}/commits?searchCriteria.itemPath=/debug.log&searchCriteria.itemVersion.version=master&api-version=5.0
Sample Response
link: <9991b4f66def4c0a9ad8f9f27043ece7eddcf1c7>;rel="startingCommitId"
{
"count": 1,
"value": [
{
"commitId": "3104bd0b0accbc74278fe6880e53215f6b93a5cd",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:05:18Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:05:18Z"
},
"comment": "Added file debug.log",
"changeCounts": {
"Add": 1,
"Edit": 0,
"Delete": 0
},
"changes": [
{
"sourceServerItem": "/debug.log",
"changeType": "add"
}
],
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/3104bd0b0accbc74278fe6880e53215f6b93a5cd",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/3104bd0b0accbc74278fe6880e53215f6b93a5cd"
}
]
}
Paging
Sample Request
GET https://dev.azure.com/fabrikam/_apis/git/repositories/{repositoryId}/commits?api-version=5.0
Sample Response
link: ;rel="next"
{
"count": 2,
"value": [
{
"commitId": "c771e2e3605c69d2435a6b34b28ac3db2c89efd2",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:38Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:38Z"
},
"comment": "Merge pull request 2 from b2 into master",
"changeCounts": {
"Add": 0,
"Edit": 0,
"Delete": 1
},
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/c771e2e3605c69d2435a6b34b28ac3db2c89efd2",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/c771e2e3605c69d2435a6b34b28ac3db2c89efd2"
},
{
"commitId": "20510720ffe1443d6ed3cb98ca340bc732ba04e5",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:32Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:32Z"
},
"comment": "Deleted README.md",
"changeCounts": {
"Add": 0,
"Edit": 0,
"Delete": 1
},
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/20510720ffe1443d6ed3cb98ca340bc732ba04e5",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/20510720ffe1443d6ed3cb98ca340bc732ba04e5"
}
]
}
Reachable from a commit
Sample Request
GET https://dev.azure.com/fabrikam/_apis/git/repositories/{repositoryId}/commits?searchCriteria.compareVersion.version=4fa42e1a7b0215cc70cd4e927cb70c422123af84&searchCriteria.compareVersion.versionType=commit&api-version=5.0
Sample Response
{
"count": 8,
"value": [
{
"commitId": "9991b4f66def4c0a9ad8f9f27043ece7eddcf1c7",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:53Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:53Z"
},
"comment": "Merged PR 2: Deleted README.md",
"commentTruncated": true,
"changeCounts": {
"Add": 0,
"Edit": 0,
"Delete": 1
},
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/9991b4f66def4c0a9ad8f9f27043ece7eddcf1c7",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/9991b4f66def4c0a9ad8f9f27043ece7eddcf1c7"
},
{
"commitId": "c771e2e3605c69d2435a6b34b28ac3db2c89efd2",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:38Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:38Z"
},
"comment": "Merge pull request 2 from b2 into master",
"changeCounts": {
"Add": 0,
"Edit": 0,
"Delete": 1
},
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/c771e2e3605c69d2435a6b34b28ac3db2c89efd2",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/c771e2e3605c69d2435a6b34b28ac3db2c89efd2"
},
{
"commitId": "20510720ffe1443d6ed3cb98ca340bc732ba04e5",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:32Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:32Z"
},
"comment": "Deleted README.md",
"changeCounts": {
"Add": 0,
"Edit": 0,
"Delete": 1
},
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/20510720ffe1443d6ed3cb98ca340bc732ba04e5",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/20510720ffe1443d6ed3cb98ca340bc732ba04e5"
},
{
"commitId": "4bac640ecfd017eeadfd282a8e31bcd8ab6d132b",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:17Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:17Z"
},
"comment": "Merged PR 1: Added file debug.log",
"commentTruncated": true,
"changeCounts": {
"Add": 1,
"Edit": 0,
"Delete": 0
},
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/4bac640ecfd017eeadfd282a8e31bcd8ab6d132b",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/4bac640ecfd017eeadfd282a8e31bcd8ab6d132b"
},
{
"commitId": "8921e81180bdf0e8b448be302698e425273e9df0",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:05:28Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:05:28Z"
},
"comment": "Merge pull request 1 from b1 into master",
"changeCounts": {
"Add": 1,
"Edit": 0,
"Delete": 0
},
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/8921e81180bdf0e8b448be302698e425273e9df0",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/8921e81180bdf0e8b448be302698e425273e9df0"
},
{
"commitId": "3104bd0b0accbc74278fe6880e53215f6b93a5cd",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:05:18Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:05:18Z"
},
"comment": "Added file debug.log",
"changeCounts": {
"Add": 1,
"Edit": 0,
"Delete": 0
},
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/3104bd0b0accbc74278fe6880e53215f6b93a5cd",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/3104bd0b0accbc74278fe6880e53215f6b93a5cd"
},
{
"commitId": "9c1e8b082e2c2f041bdd5db76d6bf5c11572524f",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:04:45Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:04:45Z"
},
"comment": "Added file file1.txt",
"changeCounts": {
"Add": 1,
"Edit": 0,
"Delete": 0
},
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/9c1e8b082e2c2f041bdd5db76d6bf5c11572524f",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/9c1e8b082e2c2f041bdd5db76d6bf5c11572524f"
},
{
"commitId": "4fa42e1a7b0215cc70cd4e927cb70c422123af84",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:04:22Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:04:22Z"
},
"comment": "Added README.md file",
"changeCounts": {
"Add": 1,
"Edit": 0,
"Delete": 0
},
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/4fa42e1a7b0215cc70cd4e927cb70c422123af84",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/4fa42e1a7b0215cc70cd4e927cb70c422123af84"
}
]
}
Reachable from a commit and path
Sample Request
GET https://dev.azure.com/fabrikam/_apis/git/repositories/{repositoryId}/commits?searchCriteria.itemPath=/README.md&searchCriteria.compareVersion.version=master&searchCriteria.itemVersion.version=4fa42e1a7b0215cc70cd4e927cb70c422123af84&searchCriteria.itemVersion.versionType=commit&api-version=5.0
Sample Response
link: <4fa42e1a7b0215cc70cd4e927cb70c422123af84>;rel="startingCommitId"
{
"count": 1,
"value": [
{
"commitId": "20510720ffe1443d6ed3cb98ca340bc732ba04e5",
"author": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:32Z"
},
"committer": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2018-06-15T17:06:32Z"
},
"comment": "Deleted README.md",
"changeCounts": {
"Add": 0,
"Edit": 0,
"Delete": 1
},
"changes": [
{
"sourceServerItem": "/README.md",
"changeType": "delete"
}
],
"url": "https://dev.azure.com/fabrikam/1fec3816-a6f6-4d90-97eb-3bc4630ac416/_apis/git/repositories/1701bc47-1145-4739-a805-64b02e40dbe7/commits/20510720ffe1443d6ed3cb98ca340bc732ba04e5",
"remoteUrl": "https://dev.azure.com/fabrikam/SomeGitProject/_git/SampleRepository/commit/20510720ffe1443d6ed3cb98ca340bc732ba04e5"
}
]
}
Definições
Nome | Description |
---|---|
Change |
|
Git |
|
Git |
Fornece propriedades que descrevem um commit do Git e metadados associados. |
Git |
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. |
Git |
|
Git |
Essa classe contém os metadados de um serviço/extensão postando um status. |
Git |
Contexto de status que identifica exclusivamente o status. |
Git |
Estado do status. |
Git |
|
Git |
Informações do usuário e data das operações do Git. |
Git |
Opções de versão – especificar modificadores adicionais para a versão (por exemplo, Anterior) |
Git |
Tipo de versão (branch, marca ou commit). Determina como a ID é interpretada |
Identity |
|
Item |
|
Item |
|
Reference |
A classe para representar uma coleção de links de referência REST. |
Resource |
|
Version |
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 |
O tipo de alteração feita no item. |
|
item |
string |
Versão atual. |
newContent |
Conteúdo do item após a alteração. |
|
newContentTemplate |
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 |
Uma coleção de links de referência REST relacionados. |
|
author |
Autor do commit. |
|
changeCounts |
Contagens dos tipos de alterações (edições, exclusões etc.) incluídas no commit. |
|
changes |
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. |
committer |
Committer do commit. |
|
parents |
string[] |
Uma enumeração das IDs de commit pai para esse commit. |
push |
O push associado a esse commit. |
|
remoteUrl |
string |
Caminho da URL remota para o commit. |
statuses |
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 |
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 |
fullHistory |
string |
O modo de histórico usado por |
fullHistorySimplifyMerges |
string |
O modo de histórico usado por |
simplifiedHistory |
string |
O modo de histórico usado por |
GitPushRef
Nome | Tipo | Description |
---|---|---|
_links |
A classe para representar uma coleção de links de referência REST. |
|
date |
string |
|
pushId |
integer |
|
pushedBy | ||
url |
string |
GitStatus
Essa classe contém os metadados de um serviço/extensão postando um status.
Nome | Tipo | Description |
---|---|---|
_links |
Links de referência. |
|
context |
Contexto do status. |
|
createdBy |
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 |
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. |
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 |
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 |
|
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 |
|
inactive |
boolean |
|
isAadIdentity |
boolean |
|
isContainer |
boolean |
|
isDeletedInOrigin |
boolean |
|
profileUrl |
string |
|
uniqueName |
string |
|
url |
string |
Essa URL é a rota completa para o recurso de origem desta entidade de grafo. |
ItemContent
Nome | Tipo | Description |
---|---|---|
content |
string |
|
contentType |
ItemContentType
Nome | Tipo | Description |
---|---|---|
base64Encoded |
string |
|
rawText |
string |
ReferenceLinks
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 |