Re: New orphan worktree?
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Feb 22, 2021, 23:59 UTC
- Message-ID
- <xmqqmtvv64dp.fsf@gitster.g>
- In-Reply-To
- <CAPig+cSkL+5otKUWwm=CLaRR+j71wW61U7LWtmuUHO+7bZaY_g@mail.gmail.com>
Eric Sunshine <sunshine@sunshineco.com> writes:
Show 6 quoted lines
> When I was pondering the issue before writing my original response, > two thoughts came to mind. (1) "git worktree add --force --orphan > <branch>" would be one way to make your case work; (2) given how > infrequently --orphan is used, we just punt and require people to > first use "git branch -D <branch>" if necessary (which has been the > status-quo for git-branch and git-switch).
FWIW, as I personally view that branch -d/-D, checkout -b/-B, and switch -c/-C were all mistakes (they should have been -d, -b and -c with and without --force, respectively), I find the combination of "--force --orphan" a reasonable way forward.