---
title: "Create a Patch"
manual: "TYPO3 Core Contribution Guide"
version: "main"
permalink: "https://docs.typo3.org/permalink/t3contribute:quickstart-create-a-patch"
source: "BugfixingAZ/Index.rst"
rendered: "2026-10-05T15:34:44+00:00"
---

...  highlight:: shell

# Create a Patch {#quickstart-create-a-patch}

**Quick links:**

-   [git setup](https://docs.typo3.org/permalink/t3contribute:setting-up-your-git-environment)
-   [git cheat sheet](https://docs.typo3.org/permalink/t3contribute:cheat-sheet-git)
-   [Commit Message rules](https://docs.typo3.org/permalink/t3contribute:commitmessage)
-   [Deprecations](https://docs.typo3.org/permalink/t3contribute:deprecations)
-   [Testing](https://docs.typo3.org/permalink/t3contribute:testing)
-   [Add Documentation](https://docs.typo3.org/permalink/t3contribute:adding-documentation)

So you want to fix a bug or add a new feature to TYPO3? **Great!**

> [!TIP]
> If you
> should encounter any problems or have questions, talk to us on
> [https://typo3.slack.com](https://typo3.slack.com) in the **#typo3-cms-coredev** channel
> (see [Slack](https://docs.typo3.org/permalink/t3contribute:appendix-slack-intro)).

## Step by Step Walkthrough {#fix-the-code}

You should have a cloned Git repository with a working TYPO3 installation
as described in [setup](https://docs.typo3.org/permalink/t3contribute:setup) (or via the
[Quick start guide](https://docs.typo3.org/permalink/t3contribute:quickstart)). Especially the
[Git setup](https://docs.typo3.org/permalink/t3contribute:setting-up-your-git-environment) is required.

1.  Create an Issue on Forge

    More information: [Report an Issue](https://docs.typo3.org/permalink/t3contribute:bugreporting-index)

    Every patch must have a matching issue on
    [Forge](https://forge.typo3.org/projects/typo3cms-core/issues),
    so create an issue now or submit
    a patch for an existing issue.
1.  Make your changes to the code, add documentation, tests

    This part is pretty straightforward. But be warned, there
    are still a few dark places deep inside the TYPO3 core dating back to the
    medieval times of PHP4. Yes, TYPO3 has been around for quite some time now. And
    there is ancient code we didn't have to touch yet because it just works.

    Make sure to look at [how to deprecate classes, methods, arguments and hooks](https://docs.typo3.org/permalink/t3contribute:deprecations) in the Appendix for information
    about how to deprecate things if you need to make changes to the public API.

    For new features, breaking changes and deprecations, it is necessary to [add
    information to the changelog](https://docs.typo3.org/permalink/t3contribute:changelog).

    If you change SCSS, JavaScript or TypeScript files, you can [build](https://docs.typo3.org/permalink/t3contribute:build)
    locally.

    Add Unit Tests or Functional Tests for new functionality, refine existing tests
    if necessary. Tests are important because they ensure that
    TYPO3 will behave consistently now and in the future.

    See [Testing the core](https://docs.typo3.org/permalink/t3contribute:testing) in TYPO3 Explained for more information
    about writing and running tests.

    Once you have finalized your patch, check out the [Common code review checks](https://docs.typo3.org/permalink/t3contribute:common-review-checks)
    for a list of what kind of review checks people may perform on your contribution.
    Stay ahead of the game and address those yourself first.
1.  Commit your changes

    Please make sure that you read the [commit message rules](https://docs.typo3.org/permalink/t3contribute:commitmessage) in the Appendix.
    Your code will not be merged if it does not follow the commit message
    rules.

    > [!IMPORTANT]
    > The section [the commit message rules](https://docs.typo3.org/permalink/t3contribute:commitmessage) is a must-read. Read it. Follow it.

    For a bugfix, your commit message may look something like this:

    **commit message**

    ```text
    [BUGFIX] Subject line of max 52 chars

    Some descriptions with line length of max. 72 characters

    Resolves: #12346
    Releases: main, 13.4
    ```

    Only create one commit. Do not create a branch. Work on main.

    **shell command**

    ```bash
    git commit -a
    ```

    The [commit-msg hook](https://docs.typo3.org/permalink/t3contribute:pre-commit-hook) will do some sanity
    checks and add a line starting with `Change-Id:`.

    If you have activated the [pre-commit hook](https://docs.typo3.org/permalink/t3contribute:pre-commit-hook)
    it will loudly complain if something does not conform to the coding guidelines.

    In that case, use the [runTests.sh](https://docs.typo3.org/permalink/t3contribute:runtestsshcgl) script to to fix CGL
    issues.

    After you have created your commit, you can still make changes by
    amending to your commit:

    **shell command**

    ```bash
    git commit -a --amend
    ```

    > [!TIP]
    > Keep in mind that you can commit with --amend **as often as you want,**
    > make sure you keep the `Change-Id:` line intact.
1.  Push to Gerrit

    To submit the patch to Gerrit, issue the following command:

    **shell command**

    ```bash
    git push origin HEAD:refs/for/main
    ```

    If you have setup the default as described in [Setting up Your Remote](https://docs.typo3.org/permalink/t3contribute:git-setup-remote)
    it is sufficient to use:

    **shell command**

    ```bash
    git push
    ```

    In case you want to push a "Work in progress", check out:
    [the work in progress workflow](https://docs.typo3.org/permalink/t3contribute:git-work-in-progress).

    If Gerrit accepts your push, it responds with the following messages:

    **result**

    ```none
    remote: SUCCESS
    remote:
    remote:   https://review.typo3.org/c/Packages/TYPO3.CMS/+/<gerrit-id> [...] ... [NEW]
    remote:
    To ssh://review.typo3.org:29418/Packages/TYPO3.CMS.git
    * [new reference]         main -> refs/for/main
    ```

    If you see an error, check out the [Git Troubleshooting](https://docs.typo3.org/permalink/t3contribute:git-troubleshooting)
    section.

    You can visit the link to [https://review.typo3.org](https://review.typo3.org) to see your patch in Gerrit.

    The Continuous Integration service, running on GitLab Pipelines, will automatically
    be executed in the background and perform checks and tests on your patch.
    Failing tests will be linked to that instance, where jobs can also be retried
    (given sufficient permissions when being logged in to GitLab).

    Advanced users / core team only: See
    [cheat sheet: other branches](https://docs.typo3.org/permalink/t3contribute:cheat-sheet-git-other-branches)
    for pushing to other branches.
1.  Optional: Advertise review on Slack channel

-   **Once your push to [Gerrit](https://review.typo3.org) goes through, you will receive a URL for your new**

    change. If you are on [Slack](https://typo3.slack.com) you can now advertise
    your new change in the **#typo3-cms-coredev** channel. You can get a preformatted
    line of your change to post in the channel by clicking the copy button next to the title in Gerrit\_:

    ![](../Images/External/Forge/copy-slack-link.png)
    This is not something, you will do for every review. As a first contributor
    it is recommended to mention that you are new to the process.

Now, it's time to sit back and await feedback on your changes. The review team process
dozens of requests each day, so expect a succinct response that is short and to the point.
You will get notified by email, if there is activity on your patch in Gerrit
(e.g. votes, comments, new patchsets, merge etc.).

Check out the section [Review a patch](https://docs.typo3.org/permalink/t3contribute:reviewpatch) for more about this process, in which you can
also be involved!

It is not unusual for a patch to get comments requesting changes. If that happens,
please respond in a timely fashion and improve your review. If things are unclear,
ask in the **#typo3-cms-coredev** channel on [https://typo3.slack.com](https://typo3.slack.com).

## Helpful links {#helpful-links}

-   [Gerrit](https://review.typo3.org) Review server
-   [Forge](https://forge.typo3.org) Issue tracker
-   [Forger](https://forger.typo3.com) Search for reviews and issues
-   [Slack](https://slack.typo3.org) chat system

## Next Steps {#next-steps}

You will find some more information about the review process in the chapter
[handling and improving a patch](https://docs.typo3.org/permalink/t3contribute:lifeofapatch). The following pages are especially relevant
for new contributors:

-   [the tips for new contributors](https://docs.typo3.org/permalink/t3contribute:new-contributors-tips)
-   [the introduction to Gerrit](https://docs.typo3.org/permalink/t3contribute:working-with-gerrit) describes the review tool Gerrit.
-   [Find a review on Gerrit](https://docs.typo3.org/permalink/t3contribute:find-a-review) is helpful if you don't know how to find your patch on Gerrit.
-   Gerrit works with up- and downvoting patches. A patch must get a specific number of
    upvotes before it can be merged. [Code Review](https://docs.typo3.org/permalink/t3contribute:lifeofapatch-review) gives
    an introduction to how this works.
-   When you make additional changes to your patch, make sure you do not add another
    commit. Append to your original commit instead as described in
    [Upload a new Patch Set](https://docs.typo3.org/permalink/t3contribute:lifeofapatch-improve-patch).
-   Before starting to work on a new, unrelated patch you need to run the [Cleanup tasks](https://docs.typo3.org/permalink/t3contribute:cleanup-tasks).
