How to remove range of git stash?

前端 未结 4 1714
没有蜡笔的小新
没有蜡笔的小新 2021-01-04 02:07

I want to remove all stash\'es, except most recent, from git stash list.

E.g. I want to remove stash 1 to 3 in a single git command:

4条回答
  •  -上瘾入骨i
    2021-01-04 02:31

    Supposedly you want to drop all old stashes except the first one you can use a script like this:

    for (( ; ; ))
    do
        git stash drop stash@{1}
        Result = $?
        if [ Result != 0 ] 
        then
          break
        fi
    done
    
    

提交回复
热议问题