git/list[1] front-page[2] threads[3] people[4] search[5] about
 

$GIT_DIR usage

From
DZDan Zwell <dzwell@gmail.com>
Date
Aug 5, 2007, 09:58 UTC
Message-ID
<46B59F63.8020707@gmail.com>

Hi, I had a question about $GIT_DIR. That is to say, it doesn't seem to work. I am using Git 1.5.2.4. See the following: (all the commands I tried besides "git-init" failed).

$ export GIT_DIR="`pwd`/.git_public" $ git init warning: templates not found /usr/share//git-core/templates/ Initialized empty Git repository in /home/user/temp/.git_public/ $ echo > new_file $ git add new_file fatal: add must be run in a work tree $ git commit -a fatal: /usr/bin/git-commit cannot be used without a working tree. $ git commit fatal: /usr/bin/git-commit cannot be used without a working tree. $

Is $GIT_DIR not meant to be used this way? Does it have a different purpose / use case, or is this just a bug?

Thanks, Dan

Next: Dmitry Kakurin
Message 1 of 6 in “$GIT_DIR usage”
  1. Dan ZwellAug 5, 2007
  2. Dmitry KakurinAug 5, 2007
  3. Dan ZwellAug 5, 2007
  4. Johannes SchindelinAug 5, 2007
  5. Dan ZwellAug 5, 2007
  6. Johannes SchindelinAug 5, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.