Thread (1 message) 1 message, 1 author, 2023-01-13

Re: [PATCH v8 3/4] worktree add: add --orphan flag

From: Junio C Hamano <hidden>
Date: 2023-01-13 17:45:20

Phillip Wood [off-list ref] writes:
quoted
% 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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help