az-400 Practice Question 1976

Exam: az-400
Domain: Design and implement source control
Topic: Design and implement a source control strategy
Difficulty: medium
A developer needs to make a critical bug fix in the production codebase without disrupting ongoing development work. Which branching strategy and process should they follow to ensure the fix is applied correctly and reviewed before being merged back into the main branch?

Answer Options

A
Create a hotfix branch from the current production branch
B
Create a new feature branch and merge it into the trunk
C
Directly modify the production branch
D
Use GitFlow to create a release branch for the fix

Correct Answer

A: Create a hotfix branch from the current production branch

Explanation

For a critical bug fix, the developer should create a hotfix branch from the current production branch, apply the fix, and then merge it back into both the production and development branches after thorough testing and review via pull requests. This process ensures that the fix is isolated, tested, and reviewed before being integrated into the main codebase, maintaining the stability of the production environment.

Related Practice Questions