Hello Duy,

thanks for your answer.

Your assumption is correct: when renaming the directory apparently I have not 
adjusted /git/A/.git/worktrees/B/gitdir to the new location.

I fixed the situation by renaming /git/B to /git/B.bak, creating a new worktree 
pointing to /git/B (with branch g), then deleting /git/B and moving /git/B.bak 
to /git/B .

Consider adjusting the documentation as suggested below, possibly using a 
different wording.

Regards
  Дилян

On 03/02/18 00:56, Duy Nguyen wrote:
On Fri, Mar 2, 2018 at 3:14 AM, Eric Sunshine <sunsh...@sunshineco.com> wrote:
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.

"git worktree prune" does, which is called by "git gc" and that was
actually executed from the command output in the original mail.

Дилян Палаузов did you move /git/B away manually? For example, you
originally created "B" with

git worktree add /somewhere/B g

then you do this at some point

mv /somewhere/B /git/B


Signed-off-by Дилян Палаузов <git-...@aegee.org>
---
diff --git a/Documentation/git-gc.txt b/Documentation/git-gc.txt
index 571b5a7..33655c4 100644
--- a/Documentation/git-gc.txt
+++ b/Documentation/git-gc.txt
@@ -15,8 +15,8 @@ DESCRIPTION
 -----------
 Runs a number of housekeeping tasks within the current repository,
 such as compressing file revisions (to reduce disk space and increase
-performance) and removing unreachable objects which may have been
-created from prior invocations of 'git add'.
+performance), removing unreachable objects, which may have been
+created from prior invocations of 'git add', and calling 'git worktree prune'.
Users are encouraged to run this task on a regular basis within
 each repository to maintain good disk space utilization and good
diff --git a/Documentation/git-worktree.txt b/Documentation/git-worktree.txt
index 5ac3f68..4b0d32f 100644
--- a/Documentation/git-worktree.txt
+++ b/Documentation/git-worktree.txt
@@ -82,7 +82,7 @@ with `--reason`.
prune:: -Prune working tree information in $GIT_DIR/worktrees.
+Prune working tree information in $GIT_DIR/worktrees.  Called implicitly by 
'git gc'.
unlock:: --
2.10.0.298.gc59cecb

Reply via email to