Re: [PATCH v8 3/4] worktree add: add --orphan flag
Phillip Wood <phillip.wood123@gmail.com> writes:
Show 13 quoted lines
>> % git -C bar.git worktree add --orphan main main/
>
> It's perhaps a bit late to bring this up but I've only just realized
> that it is unfortunate that --orphan takes a branch name rather than
> working in conjunction with -b/-B. It means that in the common case
> where the branch name is the same as the worktree the user has to
> repeat it on the command line as shown above. It also means there is
> no way to force an orphan branch (that's admittedly quite niche). If
> instead --orphan did not take an argument we could have
>
> git worktree add --orphan main
> git worktree add --orphan -b topic main
> git worktree add --orphan -B topic main
Good point. I am not sure if it is too late, though.
Thanks.