Bird
0
0

After executing git stash without any flags, what is the state of your working directory?

easy📝 Conceptual Q1 of 15
Git - Stashing
After executing git stash without any flags, what is the state of your working directory?
AThe working directory remains unchanged
BOnly staged changes are removed, unstaged changes remain
CUntracked files are saved and removed from the working directory
DAll tracked changes are removed and the working directory is clean
Step-by-Step Solution
Solution:
  1. Step 1: Run git stash

    This command saves all tracked changes (both staged and unstaged) to a new stash.
  2. Step 2: Check working directory

    After stashing, the working directory is reset to the last commit, so all tracked changes are removed.
  3. Final Answer:

    All tracked changes are removed and the working directory is clean -> Option D
  4. Quick Check:

    Tracked changes saved and cleared [OK]
Quick Trick: git stash clears tracked changes, leaving a clean directory [OK]
Common Mistakes:
  • Assuming untracked files are stashed by default
  • Thinking staged changes remain after stash
  • Believing the working directory is unchanged

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Git Quizzes