Re: What is the reason behind not hiding git worktrees from git?
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Oct 1, 2025, 20:48 UTC
- Message-ID
- <xmqqa52a1h6x.fsf@gitster.g>
- In-Reply-To
- <875xcyfk3k.fsf@osv.gnss.ru>
Sergey Organov <sorganov@gmail.com> writes:
Show 8 quoted lines
> Also, I'm almost sure that the first thing almost every worktree novice > does (I did), quite naturally, is: > > $ git wotktree add <branch> > > that happily succeeds /anywhere/ inside primary worktree without any > warning for me. It probably should either have created $top/../<branch> > instead, or refuse to proceed without confirmation in the first place.
Yeah, I almost never type 'git worktree add <directory>' without "../" at the beginning of the directory, and every time I do so, I do wonder if this is a UI pitfall that we should warn the users about. Perhaps we should start from documentation updates and possibly a new warning or two?
Thanks.