"git branch -f" corrupt other worktree
- Date: Thu, 2 May 2019 13:58:31 +0200
- From: frank kulow <kulow.f@xxxxxxxxxxxxxx>
- Subject: "git branch -f" corrupt other worktree
git version 2.21.0.windows.1
> /c/tmp/gt (Branch_702091a0)
$ git worktree add ../wt master
Preparing worktree (checking out 'master')
HEAD is now at f534c32 4
> /c/tmp/gt (Branch_702091a0)
$ git branch -D master
error: Cannot delete branch 'master' checked out at 'C:/tmp/wt'
#but this is possible:
> /c/tmp/gt (Branch_702091a0)
$ git branch -f master HEAD
#and the other worktree is now corrupted:
> /c/tmp/wt (master)
$ git status
On branch master
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
modified: txt.txt
deleted: txtb.txt
greetings f.kulow