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

Re: What's the ".git/gitdir" file?

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 28, 2015, 16:23 UTC
Message-ID
<xmqqwpu7klmu.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<CANoM8SWDHyS1P=o1FwZUnE4OVUhhFS+-dFfgPQPE-zeHtGAp3A@mail.gmail.com>
Mike Rappazzo <rappazzo@gmail.com> writes:
Show 28 quoted lines
> On Tue, Oct 27, 2015 at 6:54 PM, Junio C Hamano <gitster@pobox.com> wrote:
>> Kyle Meyer <kyle@kyleam.com> writes:
>>
>>> When a ".git" file points to another repo, a ".git/gitdir" file is
>>> created in that repo.
>>>
>>> For example, running
>>>
>>>     $ mkdir repo-a repo-b
>>>     $ cd repo-a
>>>     $ git init
>>>     $ cd ../repo-b
>>>     $ echo "gitdir: ../repo-a/.git" > .git
>>>     $ git status
>>>
>>> results in a file "repo-a/.git/gitdir" that contains
>>>
>>>     $ cat repo-a/.git/gitdir
>>>     .git
>>
>> Sounds like a bug in the recently added "worktree" stuff.  Perhaps
>> update_linked_gitdir() tweaked by 82fde87f (setup: update the right
>> file in multiple checkouts, 2015-08-25) is misbehaving?
>
> I noticed that as I was working on the worktree list command that my
> linked worktree gitdir files were being clobbered to '.git'.  I
> attributed it to my work, but now that you mention it, I think it has
> happened with the 2.6.1 release as well.

Thanks; I trust those who worked on the worktree feature in 2.6 timeframe would first take a look, OK?

Previous: Mike RappazzoNext: Nguyễn Thái Ngọc Duy
Message 7 of 18 in “What's the ".git/gitdir" file?”
  1. Kyle MeyerOct 27, 2015
  2. Stefan BellerOct 27, 2015
  3. Randall S. BeckerOct 27, 2015
  4. Stefan BellerOct 27, 2015
  5. Junio C HamanoOct 27, 2015
  6. Mike RappazzoOct 27, 2015
  7. Junio C HamanoOct 28, 2015
  8. setup: do not create $X/gitdir unnecessarily when accessing git file $XNguyễn Thái Ngọc Duy, Nov 2, 2015
  9. Eric SunshineNov 2, 2015
  10. Jeff KingNov 2, 2015
  11. Junio C HamanoNov 2, 2015
  12. Jeff KingNov 2, 2015
  13. Duy NguyenNov 3, 2015
  14. Junio C HamanoNov 3, 2015
  15. worktree: stop supporting moving worktrees manuallyNguyễn Thái Ngọc Duy, Dec 27, 2015
  16. Eric SunshineDec 28, 2015
  17. Duy NguyenDec 29, 2015
  18. Eric SunshineDec 31, 2015

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.