---
title: "Cherry-pick a patch"
manual: "TYPO3 Core Contribution Guide"
version: "main"
permalink: "https://docs.typo3.org/permalink/t3contribute:cherry-pick-a-patch"
source: "HandlingAPatch/CherryPick.rst"
rendered: "2026-10-03T08:52:39+00:00"
---

...  highlight:: bash

# Cherry-pick a patch {#cherry-pick-a-patch}

In order to test a patch or make additional changes on it, you will need
to cherry-pick it from the review system into your local git repository.

> [!IMPORTANT]
> Make sure to always get the latest patch set of the current review.
> You can check this by looking at the **Patch Sets** menu left of the
> **Download** button. If the link **Go to latest patch set**
> is not shown, you know you picked the latest patch set.

1.  Find the review on Gerrit

    see [Find a review on Gerrit](https://docs.typo3.org/permalink/t3contribute:find-a-review)
1.  Select the latest patchset and click download

    If the recent patchset is not shown, select it first:

    ![](../Images/External/Gerrit/HandlingAPatch/gerrit-go-to-latest-patchset.png)
    Then click on **Download**:

    ![](../Images/External/Gerrit/HandlingAPatch/gerrit-download.png)
1.  Click on copy next to the line for "Cherry pick"

    This copies the command to the clipboard.

    ![](../Images/External/Gerrit/HandlingAPatch/gerrit-cherry-pick.png)
1.  Clean up your local repository

    Save your local changes beforehand, if you have any. Otherwise the
    `git reset` performed after that would delete local changes, which
    may happen if you work on different patches simultaneously with the
    same repository directory.

    ```bash
    git stash save 'comment-your-changes'
    ```

    ```bash
    git fetch --all
    git reset --hard origin/main
    git pull --rebase
    ```
1.  Execute the command (git cherry-pick)

    In your shell, paste the copied command and execute it. Example:

    ```
    git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/47/56947/11 && git cherry-pick FETCH_HEAD

    ```

    Re-apply your local changes, if you had any.

    ```bash
    git stash pop 'comment-your-changes'
    ```
1.  Cleanup your TYPO3 installation

    Depending on the changes made by the patch, you may have to apply some changes
    to your TYPO3 installation as well. Also, if the last time you pulled from the
    GitHub repository is some time ago, you may need to pull the most recent
    dependencies. And you may need to rebuild the CSS/JS assets. See [cleaning up the TYPO3 installation](https://docs.typo3.org/permalink/t3contribute:cleanup-typo3).
