Tsallaka zuwa abun ciki
Justice Tech School

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.txt

Result

stash@{0}: On main: wip two
one
two

Exercise

Stash with a name.

git stash push  "wip"

Quiz Test

pop or apply?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.