Thread (1 message) 1 message, 1 author, 2025-10-01

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

From: Junio C Hamano <hidden>
Date: 2025-10-01 22:08:00

"Jakub T. Jankiewicz" [off-list ref] 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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help