GitLab API

GitlabTool

Actions1095

Commits → postApiV4ProjectsIdRepositoryCommitsShaCherryPick

AI-generated

Summary

Cherry-pick a specific commit identified by its SHA (or branch/tag name) into a target GitLab project repository branch.

Inputs

  • id (required) — The ID or URL-encoded path of the target GitLab project repository.
  • sha (required) — The commit SHA, or the name of a branch or tag, to be cherry-picked.
  • postApiV4ProjectsIdRepositoryCommitsShaCherryPick (required) — An object containing the request body parameters for the cherry-pick operation, such as the target branch and commit message.
  • skipAuthentication — Whether to skip authentication for this request (default is false).
  • baseUrl — The base URL of the GitLab instance (default is https://gitlab.com).

Output shape

A single commit object representing the new cherry-picked commit created in the target branch.

The operation returns the newly created commit data as per GitLab API v4. Authentication is required unless explicitly skipped. The id and sha path parameters are mandatory.

Examples

Example 1: Cherry-pick a commit into a branch

Specify the target project ID, the SHA of the commit to cherry-pick, and provide body parameters including the target branch name. Use the default baseUrl for GitLab.com or adjust if using self-hosted GitLab.

Links

Discussion