Bird
0
0

What will be the output after running these commands in order?

medium📝 Command Output Q4 of 15
Git - Stashing
What will be the output after running these commands in order?
git status
git stash
git status
ABoth statuses show no changes
BFirst status shows clean, second status shows changes
CFirst status shows changes, second status shows clean working directory
DBoth statuses show changes
Step-by-Step Solution
Solution:
  1. Step 1: Analyze first git status

    Before stashing, changes exist, so status shows modified files.

  2. Step 2: Analyze second git status after git stash

    After stashing, changes are saved and working directory is clean, so status shows no changes.

  3. Final Answer:

    First status shows changes, second status shows clean working directory -> Option C
  4. Quick Check:

    Status before and after stash = B [OK]
Quick Trick: Stash hides changes, so status goes from dirty to clean [OK]
Common Mistakes:
  • Expecting stash to commit changes
  • Thinking stash deletes changes
  • Confusing status outputs

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Git Quizzes