From: Junio C Hamano Date: Thu, 03 Jul 2008 04:12:04 GMT Subject: Re: [PATCH] Implement "git stash branch " Message-ID: <7v63rn61yj.fsf@gitster.siamese.dyndns.org> In-Reply-To: <20080703022316.GA25433@toroid.org> Abhijit Menon-Sen writes: > +branch []:: > + > + Creates and checks out a new branch named `` starting from > + the commit at which the `` was originally created, applies the > + changes recorded in `` to the new working tree, and drops the > + `` if that completes successfully. When no `` is given, > + applies the latest one. > ++ > +This is useful if the branch on which you ran `git stash save` has > +changed enough that `git stash apply` fails due to conflicts. Since > +the stash is applied on top of the commit that was HEAD at the time > +`git stash` was run, it restores the originally stashed state with > +no conflicts. Perhaps we would want to replay the stash always with --index for this application. By definition this will be conflict-free both in the index and in the working tree. I've also toyed with an idea to make optional, and detach the HEAD if is not given. It would be a useful mode of operation but one problem is that it is _not_ an operation that should be called "branch" anymore.