Bird
0
0

What does the command git stash push -m "save changes" file.txt do?

easy📝 Conceptual Q11 of 15
Git - Stashing
What does the command git stash push -m "save changes" file.txt do?
AIt saves changes only from <code>file.txt</code> to a new stash with a message.
BIt saves all changes in the working directory to a stash with a message.
CIt commits <code>file.txt</code> with the message "save changes".
DIt deletes <code>file.txt</code> and saves the rest to stash.
Step-by-Step Solution
Solution:
  1. Step 1: Understand the git stash push command

    This command saves changes in the working directory to a stash instead of committing.
  2. Step 2: Recognize the effect of specifying a file

    By adding file.txt, only changes in that file are saved to the stash, not all files.
  3. Final Answer:

    It saves changes only from file.txt to a new stash with a message. -> Option A
  4. Quick Check:

    Stash specific file = It saves changes only from file.txt to a new stash with a message. [OK]
Quick Trick: Use git stash push with file names to stash specific files [OK]
Common Mistakes:
  • Thinking it stashes all files without specifying
  • Confusing stash with commit
  • Assuming it deletes files

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Git Quizzes