Bird
0
0

Why is it recommended to delete a feature branch after merging it into main?

hard📝 Conceptual Q10 of 15
Git - Collaboration Workflows
Why is it recommended to delete a feature branch after merging it into main?
ABecause Git automatically deletes merged branches
BTo prevent others from accessing the feature code
CTo keep the repository clean and avoid confusion with stale branches
DBecause the feature branch becomes the new main branch
Step-by-Step Solution
Solution:
  1. Step 1: Understand branch cleanup best practices

    Deleting merged feature branches keeps the repository tidy and avoids confusion from old branches.
  2. Step 2: Analyze other options

    Git does not delete branches automatically. Deleting branches does not restrict access. Feature branches do not become main branches.
  3. Final Answer:

    To keep the repository clean and avoid confusion with stale branches -> Option C
  4. Quick Check:

    Delete merged branches to keep repo clean [OK]
Quick Trick: Delete merged branches to avoid clutter [OK]
Common Mistakes:
  • Thinking Git deletes branches automatically
  • Believing deletion restricts code access
  • Confusing feature branch with main branch

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Git Quizzes