fatal: 'ITK/Modules/ThirdParty/GDCM/work/extract' is a missing but already registered worktree;

Hi there,

I am trying to update GDCM module, and I have tried a naive:

$ cd ~/ITK.git/Modules/ThirdParty/GDCM
$ ./UpdateFromUpstream.sh

But this fails with:

Cloning into '/home/mmalaterre/workspace/ITK-upstream/Modules/ThirdParty/GDCM/work/upstream'...
remote: Enumerating objects: 83433, done.
remote: Counting objects: 100% (83433/83433), done.
remote: Compressing objects: 100% (18384/18384), done.
remote: Total 83433 (delta 66090), reused 81994 (delta 64835)
Receiving objects: 100% (83433/83433), 24.39 MiB | 3.43 MiB/s, done.
Resolving deltas: 100% (66090/66090), done.
++ '[' -n 8f5c7d0c3a5792d33395b239700f1cbe1442c129 ']'
++ git worktree add /home/mmalaterre/workspace/ITK-upstream/Modules/ThirdParty/GDCM/work/extract 8f5c7d0c3a5792d33395b239700f1cbe1442c129
Preparing worktree (detached HEAD 8f5c7d0c3a)
fatal: '/home/mmalaterre/workspace/ITK-upstream/Modules/ThirdParty/GDCM/work/extract' is a missing but already registered worktree;
use 'add -f' to override, or 'prune' or 'remove' to clear
+ rm -rf /home/mmalaterre/workspace/ITK-upstream/Modules/ThirdParty/GDCM/work

What operating system are you running? I have had problems running the script on OSX, and have needed to run it on GNU Linux before.

This is a Ubuntu system.

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 19.04
Release:        19.04
Codename:       disco

That happens when updating multiple times a third party module. You can safely remove the worktree .git folder.

cd /path/ITK-source;
rm -r .git/worktrees
3 Likes