Git - Update From Git
Updates the workspace with commits pushed to the connected branch.
This API supports long running operations (LRO).
To use this API, the caller's Git credentials must be configured using Update My Git Credentials API. You can use the Get My Git Credentials API to check the Git credentials configuration.
The update only affects items in the workspace that were changed in those commits. If called after the Connect and Initialize Connection APIs, it will perform a full update of the entire workspace.
Permissions
The caller must have a contributor or higher workspace role.
Required Delegated Scopes
Workspace.GitUpdate.All
Microsoft Entra supported identities
This API supports the Microsoft identities listed in this section.
| Identity | Support |
|---|---|
| User | Yes |
| Service principal and Managed identities | Only supported when all the items involved in the operation support service principals |
Interface
POST https://api.fabric.microsoft.com/v1/workspaces/{workspaceId}/git/updateFromGit
URI Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
|
workspace
|
path | True |
string (uuid) |
The workspace ID. |
Request Body
| Name | Required | Type | Description |
|---|---|---|---|
| remoteCommitHash | True |
string |
Remote full SHA commit hash. |
| conflictResolution |
Conflict resolution to be used in the update from Git operation. If items are in conflict and a conflict resolution is not specified, the update operation will not start. |
||
| options |
Options to be used in the update from Git operation |
||
| workspaceHead |
string |
Full SHA hash that the workspace is synced to. This value may be null only after Initialize Connection. In other cases, the system will validate that the given value is aligned with the head known to the system. |
Responses
| Name | Type | Description |
|---|---|---|
| 200 OK |
Request completed successfully. |
|
| 202 Accepted |
Request accepted, update from Git in progress. Headers
|
|
| 429 Too Many Requests |
The service rate limit was exceeded. The server returns a Headers Retry-After: integer |
|
| Other Status Codes |
Common error codes:
|
Examples
| Update a workspace from Git with options example |
| Update a workspace using data from a Git example |
Update a workspace from Git with options example
Sample request
POST https://api.fabric.microsoft.com/v1/workspaces/1565e6a3-c020-4c0c-dda7-92bafe99eec5/git/updateFromGit
{
"workspaceHead": "eaa737b48cda41b37ffefac772ea48f6fed3eac4",
"remoteCommitHash": "7d03b2918bf6aa62f96d0a4307293f3853201705",
"conflictResolution": {
"conflictResolutionType": "Workspace",
"conflictResolutionPolicy": "PreferWorkspace"
},
"options": {
"allowOverrideItems": true,
"itemOptionsByLogicalId": [
{
"logicalId": "88436e65-6ed1-8185-49ff-f61077fc73d4",
"options": {
"validateOnly": true
}
}
]
}
}
Sample response
Location: https://api.fabric.microsoft.com/v1/operations/431e8d7b-4a95-4c02-8ccd-6faef5ba1bd7
x-ms-operation-id: 431e8d7b-4a95-4c02-8ccd-6faef5ba1bd7
Retry-After: 30
Update a workspace using data from a Git example
Sample request
POST https://api.fabric.microsoft.com/v1/workspaces/1565e6a3-c020-4c0c-dda7-92bafe99eec5/git/updateFromGit
{
"workspaceHead": "eaa737b48cda41b37ffefac772ea48f6fed3eac4",
"remoteCommitHash": "7d03b2918bf6aa62f96d0a4307293f3853201705",
"conflictResolution": {
"conflictResolutionType": "Workspace",
"conflictResolutionPolicy": "PreferWorkspace"
},
"options": {
"allowOverrideItems": true
}
}
Sample response
Location: https://api.fabric.microsoft.com/v1/operations/431e8d7b-4a95-4c02-8ccd-6faef5ba1bd7
x-ms-operation-id: 431e8d7b-4a95-4c02-8ccd-6faef5ba1bd7
Retry-After: 30
Definitions
| Name | Description |
|---|---|
|
Conflict |
Conflict resolution policy. Additional conflict resolution policies may be added over time. |
|
Conflict |
Conflict resolution type. Additional conflict resolution types may be added over time. |
|
Error |
A structured parameter providing additional machine-readable context about an error. |
|
Error |
The error related resource details object. |
|
Error |
The error response. |
|
Error |
The error response details. |
|
Item |
A per-item options entry that targets its item by logical ID. Each targeted item may appear at most once. |
|
Update |
Contains the update from Git request data. |
|
Update |
Contains the options that are enabled for the update from Git. |
|
Workspace |
The basic conflict resolution data. |
ConflictResolutionPolicy
Conflict resolution policy. Additional conflict resolution policies may be added over time.
| Value | Description |
|---|---|
| PreferRemote |
Prefer remote Git side content. |
| PreferWorkspace |
Prefer workspace side content. |
ConflictResolutionType
Conflict resolution type. Additional conflict resolution types may be added over time.
| Value | Description |
|---|---|
| Workspace |
Conflict resolution representing the workspace level. |
ErrorParameter
A structured parameter providing additional machine-readable context about an error.
| Name | Type | Description |
|---|---|---|
| message |
string |
A human-readable description of the parameter's meaning. |
| name |
string |
The parameter identifier. |
| value |
string |
The parameter value. |
ErrorRelatedResource
The error related resource details object.
| Name | Type | Description |
|---|---|---|
| resourceId |
string |
The resource ID that's involved in the error. |
| resourceType |
string |
The type of the resource that's involved in the error. |
ErrorResponse
The error response.
| Name | Type | Description |
|---|---|---|
| errorCode |
string |
A specific identifier that provides information about an error condition, allowing for standardized communication between our service and its users. |
| isRetriable |
boolean |
When true, the request can be retried. Use the |
| message |
string |
A human readable representation of the error. |
| moreDetails |
List of additional error details. |
|
| parameters |
Structured parameters providing additional machine-readable context about the error. |
|
| relatedResource |
The error related resource details. |
|
| requestId |
string (uuid) |
ID of the request associated with the error. |
ErrorResponseDetails
The error response details.
| Name | Type | Description |
|---|---|---|
| errorCode |
string |
A specific identifier that provides information about an error condition, allowing for standardized communication between our service and its users. |
| message |
string |
A human readable representation of the error. |
| parameters |
Structured parameters providing additional machine-readable context about the error. |
|
| relatedResource |
The error related resource details. |
ItemOptionsByLogicalIdEntry
A per-item options entry that targets its item by logical ID. Each targeted item may appear at most once.
| Name | Type | Description |
|---|---|---|
| logicalId |
string (uuid) |
The logical ID of the target item. |
| options |
object |
The options for the targeted item. Property names are option names valid for the item type; values are the option values. For the options supported by a specific item type, see that item type's |
UpdateFromGitRequest
Contains the update from Git request data.
| Name | Type | Description |
|---|---|---|
| conflictResolution |
Conflict resolution to be used in the update from Git operation. If items are in conflict and a conflict resolution is not specified, the update operation will not start. |
|
| options |
Options to be used in the update from Git operation |
|
| remoteCommitHash |
string |
Remote full SHA commit hash. |
| workspaceHead |
string |
Full SHA hash that the workspace is synced to. This value may be null only after Initialize Connection. In other cases, the system will validate that the given value is aligned with the head known to the system. |
UpdateOptions
Contains the options that are enabled for the update from Git.
| Name | Type | Description |
|---|---|---|
| allowOverrideItems |
boolean |
User consent to override incoming items during the update from Git process. When incoming items are present and the allow override items is not specified or is provided as false, the update operation will not start. Default value is false. |
| itemOptionsByLogicalId |
Per-item update options. Each entry targets its item by logical ID and applies its options to that item. |
WorkspaceConflictResolution
The basic conflict resolution data.
| Name | Type | Description |
|---|---|---|
| conflictResolutionPolicy |
Conflict resolution policy. Additional conflict resolution policies may be added over time. |
|
| conflictResolutionType |
Conflict resolution type. Additional conflict resolution types may be added over time. |