Volume XXII, number 279Tuesday, October 6, 2026Latest message 46 minutes ago

The Git List

News and archive of git@vger.kernel.org, since April 2005

[bug] git worktree add deletes my entire directory

2 messages between Sep 7, 2026 and Sep 8, 2026, from Paul DE TEMMERMAN, Tuomas Ahola.

Plain Markdown or JSON for tools and agents.

Paul DE TEMMERMANSep 7, 2026, 22:12 UTC on lore

What did you do before the bug happened? (Steps to reproduce your issue) git init touch a.txt git add . git commit -m "Initial commit" git worktree add "" HEAD

What did you expect to happen? (Expected behavior) fail and not delete my workspace

What happened instead? (Actual behavior) failed and deleted my workspace (including the .git directory)

What's different between what you expected and what actually happened? Git deleted my entire workspace and the .git directory.

Anything else you want to add: No

Please review the rest of the bug report below. You can delete any lines you don't wish to share.

[System Info]
git version:
git version 2.55.0.windows.5
cpu: x86_64
built from commit: 32c4f7689275d233577576630e1ac5b7eb354eb0
sizeof-long: 4
sizeof-size_t: 8
shell-path: D:/git-sdk-64-build-installers/usr/bin/sh
rust: disabled
feature: fsmonitor--daemon
gettext: enabled
libcurl: 8.21.0
OpenSSL: OpenSSL 3.5.7 9 Jun 2026
zlib: 1.3.2
SHA-1: SHA1_DC
SHA-256: SHA256_BLK
default-ref-format: files
default-hash: sha1
uname: Windows 10.0 26200
compiler info: gnuc: 16.2
libc info: no libc information available
$SHELL (typically, interactive shell): C:\Program Files\Git\usr\bin\bash.exe

[Enabled Hooks] not run from a git repository - no hooks to show

Tuomas AholaSep 8, 2026, 08:21 UTC in reply to Paul DE TEMMERMAN on lore

Re: [bug] git worktree add deletes my entire directory

Paul DE TEMMERMAN <p2trman@gmail.com> wrote:
Show 19 quoted lines
> What did you do before the bug happened? (Steps to reproduce your issue)
> git init
> touch a.txt
> git add .
> git commit -m "Initial commit"
> git worktree add "" HEAD
> 
> What did you expect to happen? (Expected behavior)
> fail and not delete my workspace
> 
> What happened instead? (Actual behavior)
> failed and deleted my workspace (including the .git directory)
> 
> What's different between what you expected and what actually happened?
> Git deleted my entire workspace and the .git directory.
> 
> Anything else you want to add:
> No
> 

Thanks. The issue is being worked on, and the fix is already queued to be merged to 'master'.

Links:
  <https://github.com/git-for-windows/git/issues/6346>
  <https://lore.kernel.org/git/20260825180350.2099-1-l.s.r@web.de/T/>
Show 30 quoted lines
> Please review the rest of the bug report below.
> You can delete any lines you don't wish to share.
> 
> 
> [System Info]
> git version:
> git version 2.55.0.windows.5
> cpu: x86_64
> built from commit: 32c4f7689275d233577576630e1ac5b7eb354eb0
> sizeof-long: 4
> sizeof-size_t: 8
> shell-path: D:/git-sdk-64-build-installers/usr/bin/sh
> rust: disabled
> feature: fsmonitor--daemon
> gettext: enabled
> libcurl: 8.21.0
> OpenSSL: OpenSSL 3.5.7 9 Jun 2026
> zlib: 1.3.2
> SHA-1: SHA1_DC
> SHA-256: SHA256_BLK
> default-ref-format: files
> default-hash: sha1
> uname: Windows 10.0 26200
> compiler info: gnuc: 16.2
> libc info: no libc information available
> $SHELL (typically, interactive shell): C:\Program Files\Git\usr\bin\bash.exe
> 
> 
> [Enabled Hooks]
> not run from a git repository - no hooks to show

Back to recent threads

[bug] git worktree add deletes my entire directory | The Git List