Share via


Merges - Get

Get a specific merge operation's details.

GET https://dev.azure.com/{organization}/{project}/_apis/git/repositories/{repositoryNameOrId}/merges/{mergeOperationId}?api-version=5.1-preview.1
GET https://dev.azure.com/{organization}/{project}/_apis/git/repositories/{repositoryNameOrId}/merges/{mergeOperationId}?includeLinks={includeLinks}&api-version=5.1-preview.1

URI Parameters

Name In Required Type Description
mergeOperationId
path True

integer (int32)

OperationId of the merge request.

organization
path True

string

The name of the Azure DevOps organization.

project
path True

string

Project ID or project name

repositoryNameOrId
path True

string

The name or ID of the repository.

api-version
query True

string

Version of the API to use. This should be set to '5.1-preview.1' to use this version of the api.

includeLinks
query

boolean

True to include links

Responses

Name Type Description
200 OK

GitMerge

successful operation

Security

oauth2

Type: oauth2
Flow: accessCode
Authorization URL: https://app.vssps.visualstudio.com/oauth2/authorize&response_type=Assertion
Token URL: https://app.vssps.visualstudio.com/oauth2/token?client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearer&grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer

Scopes

Name Description
vso.code Grants the ability to read source code and metadata about commits, changesets, branches, and other version control artifacts. Also grants the ability to search code and get notified about version control events via service hooks.

Examples

Get the details of the merge request.

Sample request

GET https://dev.azure.com/{organization}/{project}/_apis/git/repositories/{repositoryNameOrId}/merges/{mergeOperationId}?api-version=5.1-preview.1

Sample response

{
  "mergeOperationId": 1,
  "status": "completed",
  "detailedStatus": {
    "mergeCommitId": "7e7460f6b61bbaa7cc2b52e4c33c0fb44d65ef9a"
  },
  "parents": [
    "638b0477e874c08482009a1ac6912b504e197ef1",
    "c34676c51971f4a89190d5b9bd7fef5368e26f17"
  ],
  "comment": "Test 1 "
}

Definitions

Name Description
GitAsyncOperationStatus
GitMerge
GitMergeOperationStatusDetail

Status information about a requested merge operation.

ReferenceLinks

The class to represent a collection of REST reference links.

GitAsyncOperationStatus

Value Description
abandoned

The operation has been abandoned.

completed

The operation has completed.

failed

The operation has failed. Check for an error message.

inProgress

The operation is currently in progress.

queued

The operation is waiting in a queue and has not yet started.

GitMerge

Name Type Description
_links

ReferenceLinks

Reference links.

comment

string

Comment or message of the commit.

detailedStatus

GitMergeOperationStatusDetail

Detailed status of the merge operation.

mergeOperationId

integer (int32)

Unique identifier for the merge operation.

parents

string[]

An enumeration of the parent commit IDs for the merge commit.

status

GitAsyncOperationStatus

Status of the merge operation.

GitMergeOperationStatusDetail

Status information about a requested merge operation.

Name Type Description
failureMessage

string

Error message if the operation failed.

mergeCommitId

string

The commitId of the resultant merge commit.

The class to represent a collection of REST reference links.

Name Type Description
links

object

The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only.