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

Re: Worktree silently deleted on git fetch/gc/log

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Mar 1, 2018, 20:14 UTC
Message-ID
<CAPig+cTPFSbT7WxyoNEOSg=3Ft1pVzkgieGp44kHnZ9=NbYsqg@mail.gmail.com>
In-Reply-To
<adf7a7a0-3571-5b68-5d15-30a9067e3826@aegee.org>

On Thu, Mar 1, 2018 at 2:24 PM, Дилян Палаузов <dilyan.palauzov@aegee.org> wrote:

> /git/A/.git/worktrees/b/ is missing - that is the point.
> /git/B/,git wasn't modified since the worktree was created, cat:
> gitdir: /git/A/.git/worktrees/b

I'll assume that the lowercase 'b' was a typo in your email (as it was in mine), and that the real content is "gitdir: /git/A/.git/worktrees/B".

You should be able to get back to a working state like this:

% cd /git/A/ % mkdir -p .git/worktrees/B % echo 'ref: refs/heads/g' >.git/worktrees/B/HEAD % echo ../.. >.git/worktrees/B/commondir % echo /git/B/.git >.git/worktrees/B/gitdir

% cd /git/B/ % git reset

As far as I know, there isn't any code in Git which would automatically remove the .git/worktrees/B directory, so it's not clear how that happened.

Previous: Дилян ПалаузовNext: Duy Nguyen
Message 4 of 10 in “Worktree silently deleted on git fetch/gc/log”
  1. Дилян ПалаузовFeb 28, 2018
  2. Eric SunshineMar 1, 2018
  3. Дилян ПалаузовMar 1, 2018
  4. Eric SunshineMar 1, 2018
  5. Duy NguyenMar 1, 2018
  6. Дилян ПалаузовMar 2, 2018
  7. Eric SunshineMar 2, 2018
  8. Duy NguyenMar 2, 2018
  9. Eric SunshineMar 3, 2018
  10. Duy NguyenMar 7, 2018

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.