Bird
0
0

You want to stash changes with a name and include untracked files, but exclude ignored files. Which command is correct?

hard📝 Workflow Q8 of 15
Git - Stashing
You want to stash changes with a name and include untracked files, but exclude ignored files. Which command is correct?
Agit stash push -m "update" -u
Bgit stash push -m "update" -a
Cgit stash push -m "update" --exclude-untracked
Dgit stash push -m "update" --no-ignored
Step-by-Step Solution
Solution:
  1. Step 1: Understand flags for untracked and ignored files

    -u includes untracked files but excludes ignored files; -a includes both untracked and ignored.
  2. Step 2: Choose correct command

    git stash push -m "update" -u uses -u to include untracked only, matching the requirement.
  3. Final Answer:

    git stash push -m "update" -u -> Option A
  4. Quick Check:

    -u includes untracked, excludes ignored [OK]
Quick Trick: -u includes untracked files, -a includes ignored too [OK]
Common Mistakes:
  • Using -a when ignored files should be excluded
  • Using non-existent flags like --no-ignored
  • Confusing --include-untracked with -u

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Git Quizzes