Bird
0
0

What does the command git rebase -i HEAD~4 allow you to do?

easy📝 Conceptual Q1 of 15
Git - Rebasing
What does the command git rebase -i HEAD~4 allow you to do?
AInteractively reorder, edit, or squash the last 4 commits
BDelete the last 4 commits permanently
CCreate a new branch from 4 commits ago
DMerge the last 4 commits into the current branch
Step-by-Step Solution
Solution:
  1. Step 1: Understand the command context

    git rebase -i HEAD~4 opens an interactive editor for the last 4 commits.
  2. Step 2: Identify the purpose of interactive rebase

    It allows you to reorder, edit, squash, or drop commits in that range.
  3. Final Answer:

    Interactively reorder, edit, or squash the last 4 commits -> Option A
  4. Quick Check:

    Interactive rebase = reorder/squash commits [OK]
Quick Trick: Use git rebase -i with HEAD~N to reorder last N commits [OK]
Common Mistakes:
  • Confusing rebase with branch creation
  • Thinking rebase deletes commits permanently
  • Mixing rebase with merge commands

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Git Quizzes