I am using bare repositories in addition to git worktree add to manage to handle multiple branches at the same time.
It turns out git clone --bare moves all files from .git/ to ./, and it is very hard to look for the added branches among all the files of .git/ in ./.
My goal is to have the following tree structure:
./
├── .git/
├── branch1/
├── branch2/
└── branch3/
.
.
.
How can I do that?
Directories containing bare repositories are by convention named
<project name>.git.You can just rename and move the directories containing the bare repository, and the different worktrees, to a common parent directory.
Naming the bare repository
.gitwould make theparentdirectory into a Git repository, which you explicitly don't want.