paperlined.org
apps > git
document updated 12 years ago, on May 2, 2012

By default, the special Git files are started in ./.git/, located at the root of the working tree.

Separate the two directories

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

Bare respository (NO working tree)

It's also possible to have no working tree:

git init --bare

git config core.bare

This setup is required to be able to have remote repos push to this one.