Bird
0
0

You have modified -app.js, index.html, and style.css. You want to stash only -app.js and style.css, then later apply those changes back. Which sequence of commands correctly does this?

hard📝 Workflow Q15 of 15
Git - Stashing
You have modified -app.js, index.html, and style.css. You want to stash only -app.js and style.css, then later apply those changes back. Which sequence of commands correctly does this?
Agit stash push -app.js style.css<br>git stash apply
Bgit stash push -m "partial stash" -- -app.js style.css<br>git stash apply stash@{0}
Cgit stash save -app.js style.css<br>git stash pop
Dgit stash push -app.js style.css<br>git stash pop stash@{1}
Step-by-Step Solution
Solution:
  1. Step 1: Stash specific files with a message

    Use git stash push -m "partial stash" -- -app.js style.css to stash only selected files with a label.
  2. Step 2: Apply the correct stash entry

    Use git stash apply stash@{0} to apply the most recent stash explicitly.
  3. Final Answer:

    git stash push -m "partial stash" -- -app.js style.css
    git stash apply stash@{0}
    -> Option B
  4. Quick Check:

    Use -m and -- with files, then apply stash by name [OK]
Quick Trick: Use -m for message and -- before files, then apply stash by reference [OK]
Common Mistakes:
  • Using deprecated git stash save
  • Omitting -- before file names
  • Applying stash without specifying correct stash reference

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Git Quizzes