How to remove range of git stash?

前端 未结 4 1712
没有蜡笔的小新
没有蜡笔的小新 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条回答
  •  别那么骄傲
    2021-01-04 02:28

    Short answer: no.

    Slightly longer answer: no, but it's trivial. You want to drop stashes 1, 2, and 3. When you drop stash #1, stashes 2 and 3 become stashes 1 and 2 respectively. When you drop the new stash #1, stash #2 (which was #3 originally) becomes stash #1. Therefore, to drop three stashes, starting with #1, simply drop stash #1 three times.

提交回复
热议问题