On Mon, Nov 25, 2019 at 10:54 AM Johannes Schindelin <Johannes.Schindelin@xxxxxx> wrote: > On Mon, 25 Nov 2019, Phillip Wood wrote: > > On 25/11/2019 03:00, Junio C Hamano wrote: > > > That "git rm -rf ." scares me, though. > > > > I know I'm not too keen on it my self but we need to empty the worktree and > > index if we're going to switch to an unborn branch > > How about `git worktree --orphan does-not-exist unborn`? git-worktree doesn't presently recognize --orphan, though it would be nice if it did. In fact, I clearly was thinking of --orphan (along with -b, -B, and --detach), when I wrote the implementation, as can be seen from the commentary in one of the original patches[1]. That --orphan never got added was either due to an oversight or it was one of those "we'll add it when someone actually needs it" deals. [1]: https://lore.kernel.org/git/1436573146-3893-11-git-send-email-sunshine@xxxxxxxxxxxxxx/