Skip to main content

How to make hotfixes after a production deployment in a Gitflow pipeline

Best practices for making urgent hotfixes to production in Gitflow.

Written by Brandon Chin Loy
Updated over a week ago

In the event that you have done a production deployment and realise that there is a critical issue that needs to be resolved, but you cannot wait until your next release to resolve it, then below are the options you have for making hotfixes.

Option 1: Hotfix Sandbox in Pipelines

Adding a Hotfix Sandbox

You can add and link one sandbox to production. This is often a designated "hotfix" developer sandbox that should mirror production at any point in time. You should spin up and create a connection for this sandbox separately before proceeding.

  1. In your production stage, select Add and then choose Add developer sandbox:

  2. Give a name to your hotfix sandbox and select the corresponding developer sandbox from the options. Once that is done, select Save:

  3. You should now see your hotfix sandbox linked to production:

Creating and Promoting Hotfixes

  1. Select your designated hotfix sandbox and select New feature:


    This will take you through our usual feature creation workflow for naming your feature branch and committing your fixes.

  2. Once you have committed your changes to the feature branch, go back to your hotfix sandbox, select your feature branch and create a pull request:

  3. Open your production environment and select the Open pull requests tab to see your hotfix pull request:


    After all the quality and/or approval gates have passed successfully, promote the hotfix to production.

Option 2: Compare & Deploy

  1. Go to Compare & Deploy.

  2. Select the developer sandbox where you made the hotfix changes as the source. For the target, select Source control, your Gitflow repo, and then your respective production branch:

  3. Choose Create new branch from main and give the feature branch a name:

  4. Select Compare now and go through our normal C&D workflow to commit your changes/fixes to this feature branch.

  5. Once you have committed your changes, select Create pull request:

  6. Enter your pull request details and ensure your target branch is your respective production branch:


    Once this is done, you can create the pull request against your main branch.

From here, go back to your pipeline and follow the guidance from Step (3) under Creating and Promoting Hotfixes above this section.

Syncing Changes to Earlier Environments

Any additional hotfixes deployed to production must be synced back to your designated integration branch and any open release branches (if applicable) to ensure they are aligned. Follow the steps below for creating sync PRs.

  1. Open your production environment and select Create sync PRs:

  2. Select Create pull request(s):

  3. You’ll now see a sync PR opened against your earlier environments:

    If you have an open release while a sync PR is created from production, you can find it in the Open pull requests tab on your release node:

Did this answer your question?