How can I delete all of my Git stashes at once? Specifically I mean, with typing in one command.

 

To delete all of your Git stashes at once, you can use the following command in your terminal:

sh
git stash clear

This command will remove all the stashes from your repository. Here's an example:

sh
$ git stash list stash@{0}: WIP on master: 2a1b3c4 Commit message stash@{1}: WIP on feature: 5d6e7f8 Another message $ git stash clear $ git stash list $

In this example, the git stash list command initially shows two stashes. After running git stash clear, both stashes are removed, and the git stash list command returns an empty list.

Remember that using git stash clear removes all stashes permanently. Make sure you don't have any important changes in your stashes before using this command.

Comments