How to delete a stash created with git stash create?

前端 未结 9 983
失恋的感觉
失恋的感觉 2020-12-04 04:28

Git stash seems to do a lot of what I want, except that it is a little hard to script, as the if you have no changes, then git stash; git stash pop will do some

相关标签:
9条回答
  • 2020-12-04 05:17

    It also works

    git stash drop <index>
    

    like

    git stash drop 5
    
    0 讨论(0)
  • 2020-12-04 05:18

    The Document is here (in Chinese)please click.

    you can use

    git stash list

    git stash drop stash@{0}

    0 讨论(0)
  • 2020-12-04 05:21

    git stash drop takes no parameter - which drops the top stash - or a stash reference which looks like: stash@{n} which n nominates which stash to drop. You can't pass a commit id to git stash drop.

    git stash drop            # drop top hash, stash@{0}
    git stash drop stash@{n}  # drop specific stash - see git stash list
    

    Dropping a stash will change the stash@{n} designations of all stashes further down the stack.

    I'm not sure why you think need to drop a stash because if you are using stash create a stash entry isn't created for your "stash" so there isn't anything to drop.

    0 讨论(0)
提交回复
热议问题