From: Stefan Beller Date: Thu, 05 Jan 2017 14:02:07 GMT Subject: Re: git branch -D doesn't work with deleted worktree Message-ID: In-Reply-To: <4D106F0FF3D29E4FA1D91C1A31CE4C3501B8DEF2E6@email.novomind.com> On Thu, Jan 5, 2017 at 2:06 AM, Roland Illig wrote: > Git 2.11.0 gives a wrong error message after the following commands: > > $ git init > $ echo hello >file > $ git add file > $ git commit -m "message" > $ git worktree add ../worktree > $ rm -rf ../worktree > $ git br -D worktree > error: Cannot delete branch 'worktree' checked out at '../worktree' > > Since ../worktree has been deleted, there cannot be anything checked out at that location. > > In my opinion, deleting the branch should just work. Especially since I used the -D option and the "git worktree" documentation says "When you are done with a linked working tree you can simply delete it." > > Regards, > Roland >