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?
- A. Fix it on develop and wait for the next release
- B. Commit the fix directly to main only
- C. Create a hotfix branch from main, fix and release it, then merge it into both main and develop
- 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.
Practise more Software Engineering, Git and Cloud Basics questionsSoftware Engineering, Git and Cloud Basics: notes and key points
More Software Engineering, Git and Cloud Basics questions
- A team practising trunk-based development wants to merge a half-built feature into main daily without exposing it to users. What makes…
- You have 2 local commits on main and the remote main has 3 new commits. What does git pull --rebase do?
- You staged changes to app.py with git add but now want them out of the next commit while keeping the edits in your working tree. Which…
- During git rebase main, a conflict stops the rebase. You edit the file to resolve it. What should you do next?
- After git fetch, git status says: "Your branch is behind 'origin/main' by 3 commits, and can be fast-forwarded." Which statement is correct?
- A repository has untracked files temp.txt and out/build.log; .log is in .gitignore. What does git clean -fd remove?