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

[PATCH] Documentation/git.txt: Mention unsupported use of --git-dir/GIT_DIR

From
Julian Phillips <julian@quantumfyre.co.uk>
Date
Mar 25, 2008, 01:10 UTC
Message-ID
<20080325011408.5507.86924.julian@quantumfyre.co.uk>
In-Reply-To
<Pine.LNX.4.64.0803250045120.30488@kaos.quantumfyre.co.uk>

We don't support using --git-dir/GIT_DIR to change the name of the .git directory, so make this clear in the documentation.

Signed-off-by: Julian Phillips <julian@quantumfyre.co.uk>
---
On Tue, 25 Mar 2008, Julian Phillips wrote:
Show 5 quoted lines
> On Mon, 24 Mar 2008, Junio C Hamano wrote:
>
>>  Junio C Hamano <gitster@pobox.com> writes:
>> 
>> > >  Well, git won't allow .git as a element anywhere in the path, when
we
Show 11 quoted lines
>> > >  should only care about the _first_ one - and also, if you use
>> > >  --git-dir=banana then we still check for '.git' ... oops.
>> > 
>> >  That's not how git-dir is supposed to used, so there is no oops.
>> 
>>  The only purpose of git-dir is to have $GIT_DIR elsewhere _outside_ the
>>  work tree.
>
> That's fair enough.  It's not enforced, or discourgaed in the
> documentation though.  Would a patch to mention that using --git-dir/GIT_DIR
> to change the name _inside_ the work tree is not supported be accepted?
i.e. this ...
 Documentation/git.txt |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/Documentation/git.txt b/Documentation/git.txt
index 3ed24d4..28cce7f 100644
--- a/Documentation/git.txt
+++ b/Documentation/git.txt
@@ -134,7 +134,8 @@ help ...'.
 
 --git-dir=<path>::
 	Set the path to the repository. This can also be controlled by
-	setting the GIT_DIR environment variable.
+	setting the GIT_DIR environment variable. Setting this to use a name
+	other than `.git` _inside_ the working tree is not supported.
 
 --work-tree=<path>::
 	Set the path to the working tree.  The value will not be
@@ -391,7 +392,8 @@ git so take care if using Cogito etc.
 'GIT_DIR'::
 	If the 'GIT_DIR' environment variable is set then it
 	specifies a path to use instead of the default `.git`
-	for the base of the repository.
+	for the base of the repository. Setting this to use a name
+	other than `.git` _inside_ the working tree is not supported.
 
 'GIT_WORK_TREE'::
 	Set the path to the working tree.  The value will not be
-- 
1.5.4.4
Previous: Julian PhillipsNext: Michael Gebetsroither
Message 7 of 10 in “[bug] git-add won't add foo/.git/bar”
  1. Michael GebetsroitherMar 24, 2008
  2. Julian PhillipsMar 25, 2008
  3. Junio C HamanoMar 25, 2008
  4. Julian PhillipsMar 25, 2008
  5. Junio C HamanoMar 25, 2008
  6. Julian PhillipsMar 25, 2008
  7. Documentation/git.txt: Mention unsupported use of --git-dir/GIT_DIRJulian Phillips, Mar 25, 2008
  8. Michael GebetsroitherMar 25, 2008
  9. Julian PhillipsMar 25, 2008
  10. Michael GebetsroitherMar 26, 2008

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.