Bird
0
0

You want to integrate changes from main into your long-running feature branch without creating merge commits. What is the best approach?

hard📝 Workflow Q8 of 15
Git - Rebasing
You want to integrate changes from main into your long-running feature branch without creating merge commits. What is the best approach?
AMerge main into your feature branch frequently
BDelete and recreate the feature branch from main
CRegularly rebase your feature branch onto main
DUse git cherry-pick for each commit from main
Step-by-Step Solution
Solution:
  1. Step 1: Identify goal to avoid merge commits

    You want to keep history linear without merge commits.
  2. Step 2: Choose method to integrate changes

    Rebasing your feature branch onto main reapplies your commits on top, avoiding merge commits.
  3. Final Answer:

    Regularly rebase your feature branch onto main -> Option C
  4. Quick Check:

    Rebase to avoid merge commits = B [OK]
Quick Trick: Rebase often to keep feature branch updated cleanly [OK]
Common Mistakes:
  • Using merge which creates merge commits
  • Deleting branches unnecessarily
  • Cherry-picking commits manually

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Git Quizzes