Skip to content

.tip

· one of the small things

git stash leaves new files behind unless you say -u

A plain stash only saves tracked changes. The file you just created stays in the working tree, where a git clean or a branch switch can eat it.

git stash push -u -m "wip: drawer"
git stash list
git stash pop

-u brings untracked files along. -m gives the stash a name, so stash@{3} still means something a week later.

git