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

前端 未结 7 2144
佛祖请我去吃肉
佛祖请我去吃肉 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 15:08

    if you want to remove the latest stash or at any particular index -

    git stash drop type_your_index

    > git stash list
    
      stash@{0}: abc
      stash@{1}: xyz
      stash@{1}: pqr
    
    > git stash drop 0
    
      Dropped refs/stash@{0}
    
    > git stash list
    
      stash@{0}: xyz
      stash@{1}: pqr
    

    if you want to remove all the stash at once -

    > git stash clear
    >
    
    > git stash list
    >
    

    Warning : Once done you can not revert back your stash

提交回复
热议问题