Bird
0
0

Given these changes:

medium📝 Command Output Q13 of 15
Git - Stashing
Given these changes:
-file1.txt modified, file2.txt modified, file3.txt unchanged.
What will be the output of git stash push -- -file1.txt followed by git stash list?
AShows an error because multiple files are modified.
BShows a stash with <code>-file1.txt</code> and <code>file2.txt</code> changes saved.
CShows a stash with only <code>-file1.txt</code> changes saved.
DShows no stash because <code>file2.txt</code> is not included.
Step-by-Step Solution
Solution:
  1. Step 1: Understand what git stash push -- -file1.txt does

    This command saves only changes from -file1.txt to a new stash.
  2. Step 2: Check the stash list output

    After stashing, git stash list shows the new stash entry with only -file1.txt changes saved.
  3. Final Answer:

    Shows a stash with only -file1.txt changes saved. -> Option C
  4. Quick Check:

    Stash specific file = stash list shows that file only [OK]
Quick Trick: Stash command saves only specified files, stash list shows saved entries [OK]
Common Mistakes:
  • Assuming all modified files are stashed
  • Expecting an error when multiple files are modified
  • Confusing stash list output with file contents

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Git Quizzes