From: Chris Torek Date: Thu, 02 Jun 2022 06:32:45 GMT Subject: Re: BUG? git stash and immediate git apply results in conflict Message-ID: In-Reply-To: On Wed, Jun 1, 2022 at 2:11 PM Akos Vandra-Meyer wrote: > git stash -ku > git stash pop This is not a bug in `git stash` itself, but rather in the way you're using it. There are two mistakes on your part here: 1: You are using `-k`, aka `--keep-index`. This flag is intended for usages that are not yours here. 2. You are *not* using `--index` in your `git pop`. The `--index` flag is intended for the kind of thing you are doing here. It's a bit unfortunate (and perhaps worth some work in the documentation) that the `--keep-index` and `--index` flags sound so similar, and yet are so different. The documentation could use some examples here, I think. Note that if you *do* want to use `--keep-index` during the `git stash` step, you will need a `git reset --hard` before your `git stash apply --index && git stash drop` step (aka `git stash pop --index`). Chris