---
title: "Replay the changes from the given commit on the branch"
method: POST
path: "/repositories/{repository}/branches/{branch}/cherry-pick"
tags: ["branches"]
---

# Replay the changes from the given commit on the branch

`POST /repositories/{repository}/branches/{branch}/cherry-pick`

## Request body

- CherryPickCreation
  - `ref` string, required — the commit to cherry-pick, given by a ref
  - `parent_number` integer — When cherry-picking a merge commit, the parent number (starting from 1) with which to perform the diff. The default branch is parent 1.
  - `commit_overrides` CommitOverrides
    - `message` string — replace the commit message
    - `metadata` object — replace the metadata of the commit
  - `force` boolean

## Response `201`

the cherry-pick commit

- Commit
  - `id` string, required
  - `parents` string[], required
  - `committer` string, required
  - `message` string, required
  - `creation_date` integer, required — Unix Epoch in seconds
  - `meta_range_id` string, required
  - `metadata` object
  - `generation` integer
  - `version` integer

## Other responses

- `400` — Validation Error
- `401` — Unauthorized
- `403` — Forbidden
- `404` — Resource Not Found
- `409` — Conflict Found
- `429` — too many requests
- `default` — Internal Server Error

---

[API](https://skmtc.net/treeverse/apis/lakefs-api.md) · [All operations](https://skmtc.net/treeverse/apis/lakefs-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/treeverse/lakefs-api/revisions/4617f80bee61/schema)
