Stash In Depth
git stash saves dirty work and cleans the tree. Name stashes with -m, list them, then pop or apply. -u includes untracked files.
Example
echo one > a.txt && git add a.txt && git commit -qm 'first'
echo two >> a.txt
git stash push -q -m 'wip two'
git stash list
git status --short
git stash pop -q
cat a.txtResult
stash@{0}: On main: wip two
one
twoExercise
Stash with a name.
git stash push "wip"
Quiz Test
These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.