CS FundamentalsModerateInfosys · Cognizant · Git interview

In GitFlow, a critical bug is found in production (main) while develop holds unreleased work. What is the standard handling?

  1. A. Fix it on develop and wait for the next release
  2. B. Commit the fix directly to main only
  3. C. Create a hotfix branch from main, fix and release it, then merge it into both main and develop
  4. D. Create a hotfix branch from develop and merge it into main

Correct answer: C. Create a hotfix branch from main, fix and release it, then merge it into both main and develop

Hotfix branches start from the production state on main, so unreleased develop work does not leak out; merging back into develop stops the bug from reappearing in the next release.

More Software Engineering, Git and Cloud Basics questions

Exams that ask this topic