There is already a worktree with branch subrepo/xxx
tlazaro opened this issue · 1 comments
tlazaro commented
Hi, I noticed there is already an issue/bug about this but my scenario seems a bit different.
$ git subrepo --version
0.4.5
$ git subrepo pull xxx
git-subrepo: There is already a worktree with branch subrepo/xxx.
Use the --force flag to override this check or perform a subrepo clean
to remove the worktree.
Cleaning doesn't fix it:
$ git subrepo clean xxx
$ git subrepo pull xxx
git-subrepo: There is already a worktree with branch subrepo/xxx.
Use the --force flag to override this check or perform a subrepo clean
to remove the worktree.
I don't know exactly how I got myself in this situation, but at some point I know I deleted .git/tmp/**
which may have been a bad idea...
What can I do to workaround this issue? I don't know which state to look into to clean up myself.
(Forcing works but overrides all the merges I have been doing and ruins a lot of work)
tlazaro commented
I found a workaround:
$ git worktree list
.../project/ 488be784e [whatever]
.../project/ /.git/tmp/subrepo/yyy 000000000 [subrepo/yyy] prunable
.../project/ /.git/tmp/subrepo/xxx 000000000 [subrepo/xxx] prunable
This removed the worktress and now I can pull on the subrepos:
$ git worktree prune
I did this onto myself but maybe the clean
command could still figure out a way of cleaning up those worktrees?