I've removed its working directory
You will have an easier time with Git 2.17+ (Q2 2018), since "git worktree
" has learned 'move
' and 'remove
' subcommands.
See commit 7f19def (04 Mar 2018) by Eric Sunshine (sunshineco
).
See commit ee6763a, commit cc73385, commit 78d986b, commit c64a8d2, commit 9f792bb, commit 9c620fc (12 Feb 2018), and commit 4ddddc1 (24 Jan 2018) by Nguyễn Thái Ngọc Duy (pclouds
).
(Merged by Junio C Hamano -- gitster
-- in commit bd0f794, 14 Mar 2018)
worktree remove
: new command
This command allows to delete a worktree. Like 'move' you cannot
remove the main worktree, or one with submodules inside.
For deleting $GIT_WORK_TREE
, Untracked files or any staged entries are
considered precious and therefore prevent removal by default. Ignored
files are not precious.
worktree remove: allow it when $GIT_WORK_TREE
is already gone
"git worktree remove
" basically consists of two things
- delete
$GIT_WORK_TREE
- delete
$GIT_DIR
(which is $SUPER_GIT_DIR/worktrees/something
)
If $GIT_WORK_TREE
is already gone for some reason, we should be able
to finish the job by deleting $GIT_DIR
.
git worktree remove
will work. See my answer below – Farsighted