0
0
Gitdevops~5 mins

Stashing specific files in Git - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is the purpose of git stash push -m "message" <file>?
It saves changes from only the specified file(s) into a new stash with a message, leaving other changes unstashed.
Click to reveal answer
beginner
How do you stash changes from only one file without affecting others?
Use git stash push <filename> to stash changes from that file only.
Click to reveal answer
beginner
What happens to unstaged changes in other files when you stash specific files?
They remain in your working directory and are not stashed or removed.
Click to reveal answer
intermediate
Can you stash changes from multiple specific files at once?
Yes, by listing multiple files after git stash push, like git stash push file1 file2.
Click to reveal answer
beginner
What command shows the list of all stashes including those with specific files?
Use git stash list to see all saved stashes with their messages.
Click to reveal answer
Which command stashes changes only from a specific file named app.js?
Agit stash push app.js
Bgit stash save app.js
Cgit stash all app.js
Dgit stash file app.js
What happens to other unstaged files when you stash a specific file?
AThey are also stashed automatically
BThey get committed
CThey get deleted
DThey remain unchanged in the working directory
How can you add a message to a stash when stashing specific files?
Agit stash save "message" <files>
Bgit stash push -m "message" <files>
Cgit stash message "message" <files>
Dgit stash add-message "message" <files>
Which command lists all stashes including those with specific files?
Agit stash all
Bgit stash show
Cgit stash list
Dgit stash status
Can you stash changes from multiple files at once?
AYes, by listing files after git stash push
BNo, you must stash all changes
CYes, but only with git stash save
DNo, only one file at a time
Explain how to stash changes from only one or more specific files in git.
Think about how to tell git exactly which files to stash.
You got /3 concepts.
    Describe what happens to unstaged changes in files not included when stashing specific files.
    Consider what git does only with the files you specify.
    You got /3 concepts.