thiagowfx's avatar

Β¬ just serendipity πŸ€ (not just serendipity)

git: empty stash

β€’ 112 words β€’ 1 min

There are too many entries in my git stash:

shell
% git stash list | wc -l
69

I would like to completely empty it, nothing there matters, it’s all draft junk accumulated over months.

shell
% git stash clear

Verification:

shell
% git stash list | wc -l
0

That’s all! It’s the first time I ran this command.

Normally I do this instead:

shell
% git stash drop

drop

Remove a single stash entry from the list of stash entries.

In zsh land, if I hadn’t learned about stash clear, I could have done the following instead:

shell
% repeat 100 git stash drop

…popping each entry one by one.