Commits - Get Commits
Récupérer des commits git pour un projet
Les paramètres qui utilisent le préfixe searchCriteria dans leur nom peuvent être spécifiés sans lui en tant que paramètres de requête, par exemple 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
Paramètres URI
Nom | Dans | Obligatoire | Type | Description |
---|---|---|---|---|
organization
|
path | True |
string |
Nom de l’organisation Azure DevOps. |
repository
|
path | True |
string |
ID ou nom convivial du dépôt. Pour utiliser le nom convivial, projectId doit également être spécifié. |
project
|
path |
string |
ID de projet ou nom du projet |
|
api-version
|
query | True |
string |
Version de l’API à utiliser. Cette valeur doit être définie sur « 7.1-preview.1 » pour utiliser cette version de l’API. |
search
|
query |
integer int32 |
Nombre d’entrées à ignorer |
|
search
|
query |
integer int32 |
Nombre maximal d’entrées à récupérer |
|
search
|
query |
string |
Alias ou nom d’affichage de l’auteur |
|
search
|
query |
string |
Identificateur de chaîne de version (nom de la balise/branche, SHA1 de commit) |
|
search
|
query |
Options de version : spécifier des modificateurs supplémentaires à la version (par exemple, précédent) |
||
search
|
query |
Type de version (branche, balise ou commit). Détermine la façon dont l’ID est interprété |
||
search
|
query |
boolean |
S’applique uniquement lorsqu’un itemPath est spécifié. Cela détermine s’il faut exclure les entrées de suppression du chemin d’accès spécifié. |
|
search
|
query |
string |
Si elle est fournie, une limite inférieure pour le filtrage valide par ordre alphabétique |
|
search
|
query |
string |
S’il est fourni, incluez uniquement les entrées d’historique créées après cette date (chaîne) |
|
search
|
query |
Quel mode d’historique Git doit être utilisé. Cela s’applique uniquement aux critères de recherche lorsque Ids = null et qu’un itemPath est spécifié. |
||
search
|
query |
string[] |
S’il est fourni, spécifie les ID de validation exacts des commits à récupérer. Ne peut pas être combiné avec d’autres paramètres. |
|
search
|
query |
boolean |
Indique s’il faut inclure le champ _links sur les références superficielles |
|
search
|
query |
boolean |
Indique s’il faut inclure les informations push |
|
search
|
query |
boolean |
Indique s’il faut inclure l’URL de l’image pour les commiteurs et les auteurs |
|
search
|
query |
boolean |
Indique s’il faut inclure des éléments de travail liés |
|
search
|
query |
string |
Chemin d’accès de l’élément sous lequel effectuer une recherche |
|
search
|
query |
string |
Identificateur de chaîne de version (nom de la balise/branche, SHA1 de commit) |
|
search
|
query |
Options de version : spécifier des modificateurs supplémentaires à la version (par exemple, précédent) |
||
search
|
query |
Type de version (branche, balise ou commit). Détermine la façon dont l’ID est interprété |
||
search
|
query |
boolean |
Si elle est activée, cette option ignore les paramètres itemVersion et compareVersion |
|
search
|
query |
string |
Si elle est fournie, une limite supérieure pour le filtrage valide par ordre alphabétique |
|
search
|
query |
string |
S’il est fourni, incluez uniquement les entrées d’historique créées avant cette date (chaîne) |
|
search
|
query |
string |
Alias ou nom d’affichage du commiter |
Réponses
Nom | Type | Description |
---|---|---|
200 OK |
opération réussie |
Sécurité
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
Nom | Description |
---|---|
vso.code | Permet de lire le code source et les métadonnées sur les commits, les ensembles de modifications, les branches et d’autres artefacts de contrôle de version. Accorde également la possibilité de rechercher du code et d’être informé des événements de contrôle de version via des hooks de service. |
Exemples
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"
}
]
}
Définitions
Nom | Description |
---|---|
Change |
|
Git |
|
Git |
Fournit des propriétés qui décrivent un commit Git et les métadonnées associées. |
Git |
Quel mode d’historique Git doit être utilisé. Cela s’applique uniquement aux critères de recherche lorsque Ids = null et qu’un itemPath est spécifié. |
Git |
|
Git |
Cette classe contient les métadonnées d’un service/d’une extension qui publie un status. |
Git |
Contexte d’état qui identifie de manière unique le status. |
Git |
État du status. |
Git |
|
Git |
Informations utilisateur et date pour les opérations Git. |
Git |
Options de version : spécifier des modificateurs supplémentaires à la version (par exemple, précédent) |
Git |
Type de version (branche, balise ou commit). Détermine la façon dont l’ID est interprété |
Identity |
|
Item |
|
Item |
|
Reference |
Classe pour représenter une collection de liens de référence REST. |
Resource |
|
Version |
Type de modification apportée à l’élément. |
ChangeCountDictionary
GitChange
Nom | Type | Description |
---|---|---|
changeId |
integer |
ID de la modification dans le groupe de modifications. |
changeType |
Type de modification apportée à l’élément. |
|
item |
string |
Version actuelle. |
newContent |
Contenu de l’élément après la modification. |
|
newContentTemplate |
Nouveau modèle de contenu à utiliser lors de l’envoi de nouvelles modifications. |
|
originalPath |
string |
Chemin d’accès d’origine de l’élément s’il est différent du chemin d’accès actuel. |
sourceServerItem |
string |
Chemin de l’élément sur le serveur. |
url |
string |
URL pour récupérer l’élément. |
GitCommitRef
Fournit des propriétés qui décrivent un commit Git et les métadonnées associées.
Nom | Type | Description |
---|---|---|
_links |
Collection de liens de référence REST associés. |
|
author |
Auteur du commit. |
|
changeCounts |
Nombre de types de modifications (modifications, suppressions, etc.) incluses dans le commit. |
|
changes |
Énumération des modifications incluses dans le commit. |
|
comment |
string |
Commentaire ou message de la validation. |
commentTruncated |
boolean |
Indique si le commentaire est tronqué à partir du message de commentaire de validation Git complet. |
commitId |
string |
ID (SHA-1) du commit. |
commitTooManyChanges |
boolean |
Indique que la validation contient trop de modifications pour être affichées |
committer |
Commiter du commit. |
|
parents |
string[] |
Énumération des ID de validation parent pour ce commit. |
push |
Push associé à ce commit. |
|
remoteUrl |
string |
Chemin d’URL distante du commit. |
statuses |
Liste des métadonnées status des services et des extensions qui peuvent associer des informations supplémentaires à la validation. |
|
url |
string |
URL REST pour cette ressource. |
workItems |
Liste des éléments de travail associés à ce commit. |
GitHistoryMode
Quel mode d’historique Git doit être utilisé. Cela s’applique uniquement aux critères de recherche lorsque Ids = null et qu’un itemPath est spécifié.
Nom | Type | Description |
---|---|---|
firstParent |
string |
Mode d’historique utilisé par |
fullHistory |
string |
Mode d’historique utilisé par |
fullHistorySimplifyMerges |
string |
Mode d’historique utilisé par |
simplifiedHistory |
string |
Mode d’historique utilisé par |
GitPushRef
Nom | Type | Description |
---|---|---|
_links |
Classe pour représenter une collection de liens de référence REST. |
|
date |
string |
|
pushId |
integer |
|
pushedBy | ||
url |
string |
GitStatus
Cette classe contient les métadonnées d’un service/d’une extension qui publie un status.
Nom | Type | Description |
---|---|---|
_links |
Liens de référence. |
|
context |
Contexte du status. |
|
createdBy |
Identité qui a créé le status. |
|
creationDate |
string |
Date et heure de création du status. |
description |
string |
Description de l’état. Décrit généralement l’état actuel du status. |
id |
integer |
Identificateur d’état. |
state |
État du status. |
|
targetUrl |
string |
URL avec status détails. |
updatedDate |
string |
Date et heure de la dernière mise à jour du status. |
GitStatusContext
Contexte d’état qui identifie de manière unique le status.
Nom | Type | Description |
---|---|---|
genre |
string |
Genre du status. En règle générale, le nom du service/de l’outil générant le status peut être vide. |
name |
string |
Identificateur de nom du status, ne peut pas être null ou vide. |
GitStatusState
État du status.
Nom | Type | Description |
---|---|---|
error |
string |
État avec une erreur. |
failed |
string |
L’état a échoué. |
notApplicable |
string |
L’état n’est pas applicable à l’objet cible. |
notSet |
string |
État non défini. État par défaut. |
pending |
string |
État en attente. |
succeeded |
string |
État réussi. |
GitTemplate
Nom | Type | Description |
---|---|---|
name |
string |
Nom du modèle |
type |
string |
Type du modèle |
GitUserDate
Informations utilisateur et date pour les opérations Git.
Nom | Type | Description |
---|---|---|
date |
string |
Date de l’opération Git. |
string |
Email adresse de l’utilisateur effectuant l’opération Git. |
|
imageUrl |
string |
URL de l’avatar de l’utilisateur. |
name |
string |
Nom de l’utilisateur effectuant l’opération Git. |
GitVersionOptions
Options de version : spécifier des modificateurs supplémentaires à la version (par exemple, précédent)
Nom | Type | Description |
---|---|---|
firstParent |
string |
Premier parent de commit (HEAD^) |
none |
string |
Non spécifié |
previousChange |
string |
Valider l’élément modifié avant la version actuelle |
GitVersionType
Type de version (branche, balise ou commit). Détermine la façon dont l’ID est interprété
Nom | Type | Description |
---|---|---|
branch |
string |
Interpréter la version en tant que nom de branche |
commit |
string |
Interpréter la version en tant qu’ID de validation (SHA1) |
tag |
string |
Interpréter la version comme un nom de balise |
IdentityRef
Nom | Type | Description |
---|---|---|
_links |
Ce champ contient zéro ou plus de liens intéressants sur le sujet du graphe. Ces liens peuvent être appelés pour obtenir des relations supplémentaires ou des informations plus détaillées sur ce sujet de graphique. |
|
descriptor |
string |
Le descripteur est le principal moyen de référencer l’objet du graphe pendant l’exécution du système. Ce champ identifie de manière unique le même sujet de graphe pour les comptes et les organisations. |
directoryAlias |
string |
Déconseillé : peut être récupéré en interrogeant l’utilisateur Graph référencé dans l’entrée « auto » du dictionnaire IdentityRef « _links » |
displayName |
string |
Il s’agit du nom d’affichage non unique du sujet du graphique. Pour modifier ce champ, vous devez modifier sa valeur dans le fournisseur source. |
id |
string |
|
imageUrl |
string |
Déconseillé : disponible dans l’entrée « avatar » du dictionnaire IdentityRef « _links » |
inactive |
boolean |
Déconseillé : peut être récupéré en interrogeant l’état d’appartenance Graph référencé dans l’entrée « membershipState » du dictionnaire GraphUser « _links » |
isAadIdentity |
boolean |
Déconseillé : peut être déduit du type d’objet du descripteur (Descriptor.IsAadUserType/Descriptor.IsAadGroupType) |
isContainer |
boolean |
Déconseillé : peut être déduit du type d’objet du descripteur (Descriptor.IsGroupType) |
isDeletedInOrigin |
boolean |
|
profileUrl |
string |
Déconseillé : non utilisé dans la plupart des implémentations préexistantes de ToIdentityRef |
uniqueName |
string |
Déconseillé : utilisez Domain+PrincipalName à la place |
url |
string |
Cette URL est l’itinéraire complet vers la ressource source de ce sujet de graphique. |
ItemContent
Nom | Type | Description |
---|---|---|
content |
string |
|
contentType |
ItemContentType
Nom | Type | Description |
---|---|---|
base64Encoded |
string |
|
rawText |
string |
ReferenceLinks
Classe pour représenter une collection de liens de référence REST.
Nom | Type | Description |
---|---|---|
links |
object |
Vue en lecture seule des liens. Étant donné que les liens de référence sont en lecture seule, nous voulons uniquement les exposer en lecture seule. |
ResourceRef
Nom | Type | Description |
---|---|---|
id |
string |
|
url |
string |
VersionControlChangeType
Type de modification apportée à l’élément.
Nom | Type | Description |
---|---|---|
add |
string |
|
all |
string |
|
branch |
string |
|
delete |
string |
|
edit |
string |
|
encoding |
string |
|
lock |
string |
|
merge |
string |
|
none |
string |
|
property |
string |
|
rename |
string |
|
rollback |
string |
|
sourceRename |
string |
|
targetRename |
string |
|
undelete |
string |