How can I delete all of my Git stashes at once?

前端 未结 7 2145
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-22 14:42

How can I delete all of my Git stashes at once?

Specifically I mean, with typing in one command.

7条回答
  •  情书的邮戳
    2020-12-22 14:49

    I had another requirement like only few stash have to be removed, below code would be helpful in that case.

    #!/bin/sh
    for i in `seq 5 8`
    do
       git stash drop stash@{$i}
    done
    

    /* will delete from 5 to 8 index*/

提交回复
热议问题