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

'git worktree repair' can't repair when main and linked worktrees are moved

From
Philippe Blain <levraiphilippeblain@gmail.com>
Date
Dec 4, 2020, 23:14 UTC
Message-ID
<63AC7AC2-5D32-479B-BF9E-0E5C31351A1B@gmail.com>
Hello,

I've had to move all my Git clones to a new filesystem. Several of them use secondary worktrees, and all are at the same level ex:

$ ls code git git2 git3 other other2 other3 ...

I had hoped to use the new 'git worktree repair' command but it seems it does not work for this use case.

I tried several things:

( cd git && git repair ) ( cd git && git repair ../git2 ) ( cd git && git repair /old/path/to/old/filesystem/git2 ) ( cd git2 && git repair /old/path/to/old/filesystem/git2 ) ( cd git2 && git repair ../git )

None of them work. Note that /old/path/to/old/filesystem/ does not exist anymore.

Is this supposed to work ? Or it's not something that 'git worktree repair' can currently cope with ?

P.S. I know how to repair the worktrees manuallly, I just wanted to test if 'repair' could help me.

Cheers,
Philippe.
Next: Philippe Blain
Message 1 of 5 in “'git worktree repair' can't repair when main and linked worktrees are moved”
  1. Philippe BlainDec 4, 2020
  2. Philippe BlainDec 4, 2020
  3. Eric SunshineDec 5, 2020
  4. Eric SunshineDec 8, 2020
  5. Philippe BlainDec 8, 2020

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.