如何删除git存储的范围? [英] How to remove range of git stash?

查看:131
本文介绍了如何删除git存储的范围?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从 git存储列表中删除​​除最近的所有存储。

例如,我想在一个git命令中将 1 移除到 3

 <$ c $在master上:测试相关的变化
stash @ {1}:在master上:Tets
stash @ {2}:在master上:集成bunyan logging和http2
stash @ {3}:在master上:集成bunyan日志和http2

我检查了这个答案 https://stackoverflow.com/a/5737041/3878940 ,但其适用于只删除一个存储。是否有任何git命令删除 stash es的范围?

解决方案

简短回答:不。



略长一点的回答:不,但很简单。您想要放下1号,2号和3号储物箱。当您放下1号储物箱时,2号和3号储物架分别成为1号和2号储物箱。当你放下新的储藏#1时,储藏#2(原本是#3)变成储藏#1。因此,从#1开始,放下三个储物箱,简单地将储物箱#1放三次。


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:

stash@{0}: On master: Test related changes
stash@{1}: On master: Tets
stash@{2}: On master: Integrate bunyan logging and http2
stash@{3}: On master: Integrate bunyan logging and http2

I checked this answer https://stackoverflow.com/a/5737041/3878940, but its applicable to delete only a single stash. Is there any git command to delete a range of stashes?

解决方案

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.

这篇关于如何删除git存储的范围?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆