git clone
supports several different types of checkouts, notably including --separate-git-dir
and --bare
.
The former works exactly like a vanilla checkout except the .git
directory is located elsewhere than directly in the working tree.
However --bare
creates a different kind of repository, significantly it
disables the reflog
and changes the
default refspec for fetch.
Both of these make --bare
a poor choice for a repository you intend to develop against, such as via worktrees.
If you just want a "bare" repository directory it is simpler[^1] to: