Bird
0
0

Why does git stash push not stash untracked files by default?

hard📝 Conceptual Q10 of 15
Git - Stashing
Why does git stash push not stash untracked files by default?
ABecause untracked files are considered temporary and not part of the project
BBecause stashing untracked files can cause conflicts with ignored files
CBecause untracked files are automatically committed
DBecause untracked files are stored in a separate stash
Step-by-Step Solution
Solution:
  1. Step 1: Understand git's treatment of untracked files

    Untracked files are new files not yet added to the project, often temporary or experimental.
  2. Step 2: Reason for default stash behavior

    Git avoids stashing untracked files by default to prevent cluttering stash with temporary files.
  3. Final Answer:

    Because untracked files are considered temporary and not part of the project -> Option A
  4. Quick Check:

    Untracked files are temporary, so not stashed by default = D [OK]
Quick Trick: Untracked files are temporary, so stash ignores them by default [OK]
Common Mistakes:
  • Thinking untracked files are committed automatically
  • Believing untracked files cause stash conflicts
  • Assuming untracked files have separate stash

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Git Quizzes