0
0
Gitdevops~5 mins

Creating named stashes in Git - Quick Revision & Summary

Choose your learning style9 modes available
Recall & Review
beginner
What is a stash in Git?
A stash in Git is a way to save your current changes temporarily without committing them, so you can work on something else and come back later.
Click to reveal answer
beginner
How do you create a named stash in Git?
Use the command git stash push -m "your message" to save your changes with a descriptive name.
Click to reveal answer
beginner
Why use a named stash instead of a default stash?
A named stash helps you remember what changes you saved, making it easier to find and apply the right stash later.
Click to reveal answer
beginner
What command lists all stashes with their names and messages?
Use git stash list to see all stashes along with their names and messages.
Click to reveal answer
intermediate
How do you apply a specific named stash?
Use git stash apply stash@{n} where n is the stash number from git stash list.
Click to reveal answer
Which command creates a named stash in Git?
Agit stash new "message"
Bgit stash push -m "message"
Cgit stash create "message"
Dgit stash save
What does the command git stash list show?
AAll saved stashes with their names and messages
BAll branches in the repository
CAll commits in the repository
DAll files changed in the last commit
Why would you use a named stash?
ATo remember what changes you saved
BTo permanently delete changes
CTo create a new branch
DTo merge two branches
How do you apply a stash after listing it?
Agit stash merge stash@{n}
Bgit stash pop stash@{n}
Cgit stash checkout stash@{n}
Dgit stash apply stash@{n}
What happens to your working directory when you create a stash?
AChanges are committed
BChanges are deleted
CChanges are saved and working directory is clean
DChanges are pushed to remote
Explain how to create a named stash and why it is useful.
Think about saving your work with a label to find it easily.
You got /4 concepts.
    Describe the steps to list and apply a specific named stash.
    First see all saved stashes, then pick one to apply.
    You got /3 concepts.