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

RE: git-dir requires work-tree; documentation improvements for working directory

From
Felipe Contreras <felipe.contreras@gmail.com>
Date
Jan 2, 2021, 19:12 UTC
Message-ID
<5ff0c58422038_90dc208ea@natae.notmuch>
In-Reply-To
<CA+RLzGCtp2T=8DG74geBs67X5vUvhwRP4FMZ6MJv+E+Pj=YbWw@mail.gmail.com>
Yaroslav Nikitenko wrote:
> I use git to manage my dotfiles with this command:
> 
>     git --git-dir=/home/yaroslav/.cfg/ --work-tree=/home/yaroslav
I do precisely the same thing.
Show 7 quoted lines
> When reading documentation, I noticed two issues.
> 
> 1) The command doesn't work without --work-tree (even from the top
> level directory, which is my home directory).
> 
>     [~]$ git --git-dir=/home/yaroslav/.cfg/ status
>     fatal: this operation must be run in a work tree

That's weird. It works fine here (although I don't see why I would want that).

If you remove all your configuration does it still fail?
Show 5 quoted lines
> 2) In the man documentation for git > git-dir it's written
> "It can be an absolute path or relative path to current working directory."
> I think this can be confused with work-tree. I suggest removing the
> word 'working' (and probably add an article 'the' before the
> 'current', but I'm not a native speaker).
Yes, the article is missing, as for the rest I have no opinion.
> I don't subscribe to the mailing list but hope that I'll receive the replies.

Don't worry. The git mailing list doesn't munge the Reply-To header, so any decent MUA will keep you in Cc.

Cheers.
-- 
Felipe Contreras
Previous: Yaroslav NikitenkoNext: Yaroslav Nikitenko
Message 2 of 7 in “git-dir requires work-tree; documentation improvements for working directory”
  1. Yaroslav NikitenkoJan 2, 2021
  2. Felipe ContrerasJan 2, 2021
  3. Yaroslav NikitenkoJan 2, 2021
  4. Felipe ContrerasJan 2, 2021
  5. Yaroslav NikitenkoJan 3, 2021
  6. Felipe ContrerasJan 3, 2021
  7. Junio C HamanoJan 4, 2021

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.