Subject: Re: What is the reason behind not hiding git worktrees from git?

From: Junio C Hamano <[email-masked]>
Date: Wed, 01 Oct 2025 15:07:57 -0700

"Jakub T. Jankiewicz" <[email-masked]> writes:

> It just didn't occur to me, that you suppose to have them out outside the
> root directory. The way I think about git is:
>
> directory/
>          .git
>          and all the stuff that belong that repo

But the point of additional worktrees is to have the stuff
additionally appear outside your normal working area, so that you
can continue working inside your primary checkout without getting
affected by those extra directories.  When you _do_ want to have
them _outside_ your primary working tree, you use them.  That is the
whole point of having additional worktrees that lets you make the
contents of other branches materialize on the filesystem.

> You don't create submodules outside of your root directory. Didn't you?

Sorry, but I do not get that question.

Submodule is attached to your superproject as part of it.  A
worktree is an additional and separate instantiation of the project
itself, which is quite a different thing.  They are apples and
oranges, as far as I can see.