Re: Need to set GIT_WORK_TREE when setting GIT_DIR !?
- From
Jonathan Nieder <jrnieder@gmail.com>
- Date
- Mar 10, 2012, 14:11 UTC
- Message-ID
- <20120310141119.GA11178@burratino>
- In-Reply-To
- <CALeToSUaPzdr=u7FfwHEtEanphVP5LZ09QdQXno52PLBTK0H-g@mail.gmail.com>
Hi,
Frédéric Heitzmann wrote:
> export GIT_DIR=$PWD/.gita && > git init
This is where the recipe goes wrong. It creates a bare repository. Using vi or "git config" to edit its configuration to set the "[core] bare" setting to false would change that.
The git-config(1) manpage says:
By default a repository that ends in "/.git" is assumed to be not bare (bare = false), while all other repositories are assumed to be bare (bare = true).
and the logic in builtin/init-db.c seems to agree.
Maybe there is a better place to document this. Improvements welcome.
Thanks, Jonathan