By default, the special Git files are started in ./.git/, located at the root of the working tree.
However, this is only the default behavior. It is not difficult to separate the two:
Git directory | Working tree | |
---|---|---|
env variables | $GIT_DIR | $GIT_WORK_TREE |
cmdline args | --git-dir | --work-tree |
git config | core.worktree | |
other | git clone --separate-git-dir | |
other | a specially-formatted file called .git |
This setup is required to be able to have remote repos push to this one.