Redigera

Dela via


Git - Update From Git

Updates the workspace with commits pushed to the connected branch.

This API supports long running operations (LRO).

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 role for the workspace.

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 No
Managed identities No

Interface

POST https://api.fabric.microsoft.com/v1/workspaces/{workspaceId}/git/updateFromGit

URI Parameters

Name In Required Type Description
workspaceId
path True

string

uuid

The workspace ID.

Request Body

Name Required Type Description
remoteCommitHash True

string

Remote full SHA commit hash.

conflictResolution

WorkspaceConflictResolution

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

UpdateOptions

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

  • Location: string
  • x-ms-operation-id: string
  • Retry-After: integer
Other Status Codes

ErrorResponse

Common error codes:

  • WorkspaceNotConnectedToGit - Workspace is not connected to git.

  • WorkspaceHasNoCapacityAssigned - No capacity assigned to workspace.

  • WorkspaceHeadMismatch - Head in the request doesn't match the head in the system.

  • WorkspacePreviousOperationInProgress - Previous operation is still in progress.

  • MissingDependency - A dependency is missing in the update operation.

  • PotentialDuplicateDisplayNameAndType - Update operation will create a duplicate display name and type.

  • DependencyDeletionFailed - Update operation will delete hard dependency.

  • InsufficientPrivileges - The caller does not have sufficient workspace permissions.

Examples

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
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.

ErrorRelatedResource

The error related resource details object.

ErrorResponse

The error response.

ErrorResponseDetails

The error response details.

UpdateFromGitRequest

Contains the update from Git request data.

UpdateOptions

Contains the options that are enabled for the update from Git.

WorkspaceConflictResolution

The basic conflict resolution data.

ConflictResolutionPolicy

Conflict resolution policy. Additional conflict resolution policies may be added over time.

Name Type Description
PreferRemote

string

Prefer remote Git side content.

PreferWorkspace

string

Prefer workspace side content.

ConflictResolutionType

Conflict resolution type. Additional conflict resolution types may be added over time.

Name Type Description
Workspace

string

Conflict resolution representing the workspace level.

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.

message

string

A human readable representation of the error.

moreDetails

ErrorResponseDetails[]

List of additional error details.

relatedResource

ErrorRelatedResource

The error related resource details.

requestId

string

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.

relatedResource

ErrorRelatedResource

The error related resource details.

UpdateFromGitRequest

Contains the update from Git request data.

Name Type Description
conflictResolution

WorkspaceConflictResolution

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

UpdateOptions

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.

WorkspaceConflictResolution

The basic conflict resolution data.

Name Type Description
conflictResolutionPolicy

ConflictResolutionPolicy

Conflict resolution policy. Additional conflict resolution policies may be added over time.

conflictResolutionType

ConflictResolutionType

Conflict resolution type. Additional conflict resolution types may be added over time.