Bird
0
0

Which Git command sequence correctly updates your local main branch and merges your feature branch in trunk-based development?

easy📝 Syntax Q3 of 15
Git - Collaboration Workflows
Which Git command sequence correctly updates your local main branch and merges your feature branch in trunk-based development?
Agit checkout feature; git pull origin feature; git merge main; git push origin feature
Bgit checkout feature; git merge origin main; git push origin main
Cgit checkout main; git fetch origin; git rebase feature; git push origin main
Dgit checkout main; git pull origin main; git merge feature; git push origin main
Step-by-Step Solution
Solution:
  1. Step 1: Identify correct update and merge commands

    To update local main, use 'git checkout main' and 'git pull origin main'. To merge feature branch, use 'git merge feature' on main, then push.
  2. Step 2: Check options for this sequence

    git checkout main; git pull origin main; git merge feature; git push origin main matches this exact sequence. Others either merge in wrong direction or omit steps.
  3. Final Answer:

    git checkout main; git pull origin main; git merge feature; git push origin main -> Option D
  4. Quick Check:

    Correct merge sequence = git checkout main; git pull origin main; git merge feature; git push origin main [OK]
Quick Trick: Update main, merge feature into main, then push [OK]
Common Mistakes:
  • Merging main into feature instead of feature into main
  • Pushing feature branch instead of main
  • Skipping pull before merge

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Git Quizzes