Bird
0
0

Consider the stash list:

medium📝 Command Output Q4 of 15
Git - Stashing
Consider the stash list:
stash@{0}: Add login feature
stash@{1}: Fix typo
stash@{2}: Refactor code

What will git stash list display after executing git stash drop stash@{0}?
Astash@{1}: Fix typo<br>stash@{2}: Refactor code
Bstash@{0}: Add login feature<br>stash@{1}: Fix typo<br>stash@{2}: Refactor code
Cstash@{0}: Fix typo<br>stash@{1}: Refactor code
Dstash@{0}: Refactor code<br>stash@{1}: Fix typo
Step-by-Step Solution
Solution:
  1. Step 1: Identify the stash to drop

    The command git stash drop stash@{0} removes the most recent stash, which is 'Add login feature'.
  2. Step 2: Understand stash reindexing

    After dropping stash@{0}, the remaining stashes shift up, so 'Fix typo' becomes stash@{0} and 'Refactor code' becomes stash@{1}.
  3. Final Answer:

    stash@{0}: Fix typo
    stash@{1}: Refactor code
    -> Option C
  4. Quick Check:

    Dropping stash@{0} shifts indexes up [OK]
Quick Trick: Dropping stash@{0} shifts all indexes up [OK]
Common Mistakes:
  • Assuming stash indexes remain unchanged after drop
  • Confusing stash@{0} with stash@{1}
  • Thinking drop removes all stashes

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Git Quizzes