Bird
0
0

What does the git rebase -i HEAD~3 command do?

easy📝 Conceptual Q1 of 15
Git - Rebasing
What does the git rebase -i HEAD~3 command do?
ADeletes the last 3 commits permanently
BMerges the last 3 commits into the current branch
CCreates a new branch from 3 commits ago
DStarts an interactive rebase for the last 3 commits
Step-by-Step Solution
Solution:
  1. Step 1: Understand the command syntax

    git rebase -i HEAD~3 means start an interactive rebase from 3 commits before HEAD.
  2. Step 2: Identify the effect of interactive rebase

    Interactive rebase lets you edit, reorder, or squash commits in the specified range.
  3. Final Answer:

    Starts an interactive rebase for the last 3 commits -> Option D
  4. Quick Check:

    Interactive rebase = Starts rebase session [OK]
Quick Trick: HEAD~N means N commits before HEAD in rebase [OK]
Common Mistakes:
  • Confusing rebase with merge
  • Thinking it deletes commits
  • Assuming it creates branches

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Git Quizzes