Hotfix
- Pronunciation
- HOT-fiks
In short
A hotfix is an urgent fix for a serious problem in production, such as a crash or security hole, released quickly and outside the normal release schedule.
What is a hotfix?
Regular changes wait for review, testing and the next release. A hotfix can't wait: users are affected now. The fix is made as small as possible, starting from exactly the code that is running in production, so nothing unrelated slips into the emergency release. It still gets a quick review and the most important automated tests, because a rushed fix that breaks something else makes the incident worse.
In Gitflow, a hotfix branch is created from main or the production tag, fixed, released as a patch version such as 2.4.1, and then merged into both main and develop so the fix isn't lost in the next release. In trunk-based development, the fix is committed to the trunk and deployed through the normal fast pipeline, or cherry-picked onto a release branch if one is in use.
Feature flags and quick rollbacks often provide the first response: switch off the broken feature or roll back to the previous version, then prepare a proper hotfix calmly. After the incident, a blameless postmortem looks at why the bug reached production and adds tests or checks so the same kind of problem is caught earlier next time.
A common misconception is that a hotfix is a shortcut around process. It is a separate, well-defined process for emergencies. Teams that hotfix constantly usually have a deeper problem, such as missing tests or risky deployments, that a faster normal pipeline would solve better.
Key takeaways
- A hotfix urgently fixes a serious production problem.
- It starts from the code that is running in production and stays minimal.
- In Gitflow, hotfix branches merge into both main and develop.
- Rollbacks and feature flags often come first, then the fix.
- Frequent hotfixes signal gaps in testing or deployment.
Example
# Start from exactly what is in production
git switch -c hotfix/2.4.1 v2.4.0
# Make the minimal fix, then commit
git commit -am "fix(checkout): handle missing shipping address"
# Release it
git tag v2.4.1 && git push origin hotfix/2.4.1 --tags
# Make sure the fix also reaches ongoing development
git switch main && git merge --no-ff hotfix/2.4.1Readers ask
What is the difference between a hotfix and a bug fix?
A bug fix goes through the normal development and release cycle. A hotfix is reserved for urgent production problems and is released immediately, outside that cycle.
What is the difference between a hotfix and a patch?
The terms overlap. A patch is any small update, often released as a patch version. A hotfix emphasizes urgency: it is shipped as soon as possible to fix a live problem.
Should a hotfix be tested?
Yes, quickly but seriously. Run the automated tests, review the change, and check the fix in staging if possible, because a broken hotfix turns one incident into two.
See also
- GitflowVersion Control, p. 24Gitflow is a Git branching model that uses long-lived main and develop branches plus feature, release, and hotfix branches to manage scheduled releases.
- Cherry-pickVersion Control, p. 3A cherry-pick in Git copies the changes from one specific commit onto your current branch as a new commit, without merging the rest of the branch it came from.
- RollbackDevOps & Cloud, p. 45A rollback is the process of returning software to a previous, known-good version after a new deployment causes errors, outages, or other unexpected problems.
- PostmortemDevOps & Cloud, p. 42A postmortem is a written review after an incident that explains what happened, why it happened, and what the team will change so it doesn't happen again.
- Semantic VersioningVersion Control, p. 35Semantic versioning is a MAJOR.MINOR.PATCH numbering scheme in which each part signals whether a release breaks compatibility, adds features, or fixes bugs.
- Feature FlagDevOps & Cloud, p. 21A feature flag is a switch in code that turns a feature on or off at runtime, letting teams deploy code without releasing it to every user at once.
Spotted a mistake or something missing on this page?Suggest an edit