Home > Software design >  What does it mean to have an already registered worktree?
What does it mean to have an already registered worktree?

Time:02-24

I'm developing inside a sandbox (linux sandboxer) enviroment. When doing git push, the test system throws this error:

git.exc.GitCommandError: Cmd('git') failed due to: exit code(128)
  cmdline: git worktree add /var/lib/snapshooter/instances/xxxxxxxxxxxxx
  stdout: 'Preparing worktree (detached HEAD xxxxxx)'
  stderr: 'fatal: '/var/lib/snapshooter/instances/xxxxxxxxxxxxx' is a missing but already registered worktree;
use 'add -f' to override, or 'prune' or 'remove' to clear'

I already ran git prune ,git gc, and regenerated the SSH key but I do not know what else to do.

CodePudding user response:

It's git worktree.

The test system creates an extra worktree to do something with the commits you are pushing. It encountered an error. The worktree /var/lib/snapshooter/instances/xxxxxxxxxxxxx had been created during a previous push. But it was not pruned properly. To fix the error, ask the test system administrator to run git worktree prune in the main worktree. The main worktree is on the test system machine.

  • Related