{"thread":{"id":"66289","subject":"[bug] git worktree add deletes my entire directory","startedAt":"2026-09-07T22:13:03Z","lastAt":"2026-09-08T08:21:22Z","messageCount":2,"participants":["Paul DE TEMMERMAN","Tuomas Ahola"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"552173","messageId":"CAN=ULkdkRqnt_TP_pawiuuhod-_XVU=uDovYNMjbgQQ2jXQVpQ@mail.gmail.com","threadId":"66289","inReplyTo":null,"subject":"[bug] git worktree add deletes my entire directory","fromName":"Paul DE TEMMERMAN","fromEmail":"p2trman@gmail.com","sentAt":"2026-09-07T22:12:50Z","receivedAt":"2026-09-07T22:13:03Z","isPatch":false,"body":"What did you do before the bug happened? (Steps to reproduce your issue)\ngit init\ntouch a.txt\ngit add .\ngit commit -m \"Initial commit\"\ngit worktree add \"\" HEAD\n\nWhat did you expect to happen? (Expected behavior)\nfail and not delete my workspace\n\nWhat happened instead? (Actual behavior)\nfailed and deleted my workspace (including the .git directory)\n\nWhat's different between what you expected and what actually happened?\nGit deleted my entire workspace and the .git directory.\n\nAnything else you want to add:\nNo\n\nPlease review the rest of the bug report below.\nYou can delete any lines you don't wish to share.\n\n\n[System Info]\ngit version:\ngit version 2.55.0.windows.5\ncpu: x86_64\nbuilt from commit: 32c4f7689275d233577576630e1ac5b7eb354eb0\nsizeof-long: 4\nsizeof-size_t: 8\nshell-path: D:/git-sdk-64-build-installers/usr/bin/sh\nrust: disabled\nfeature: fsmonitor--daemon\ngettext: enabled\nlibcurl: 8.21.0\nOpenSSL: OpenSSL 3.5.7 9 Jun 2026\nzlib: 1.3.2\nSHA-1: SHA1_DC\nSHA-256: SHA256_BLK\ndefault-ref-format: files\ndefault-hash: sha1\nuname: Windows 10.0 26200\ncompiler info: gnuc: 16.2\nlibc info: no libc information available\n$SHELL (typically, interactive shell): C:\\Program Files\\Git\\usr\\bin\\bash.exe\n\n\n[Enabled Hooks]\nnot run from a git repository - no hooks to show\n"},{"id":"552187","messageId":"20260908082119.lw3hN%taahol@utu.fi","threadId":"66289","inReplyTo":"CAN=ULkdkRqnt_TP_pawiuuhod-_XVU=uDovYNMjbgQQ2jXQVpQ@mail.gmail.com","subject":"Re: [bug] git worktree add deletes my entire directory","fromName":"Tuomas Ahola","fromEmail":"taahol@utu.fi","sentAt":"2026-09-08T08:21:19Z","receivedAt":"2026-09-08T08:21:22Z","isPatch":false,"body":"Paul DE TEMMERMAN <p2trman@gmail.com> wrote:\n\n> What did you do before the bug happened? (Steps to reproduce your issue)\n> git init\n> touch a.txt\n> git add .\n> git commit -m \"Initial commit\"\n> git worktree add \"\" HEAD\n> \n> What did you expect to happen? (Expected behavior)\n> fail and not delete my workspace\n> \n> What happened instead? (Actual behavior)\n> failed and deleted my workspace (including the .git directory)\n> \n> What's different between what you expected and what actually happened?\n> Git deleted my entire workspace and the .git directory.\n> \n> Anything else you want to add:\n> No\n> \n\nThanks.  The issue is being worked on, and the fix is already queued to be\nmerged to 'master'.\n\nLinks:\n  <https://github.com/git-for-windows/git/issues/6346>\n  <https://lore.kernel.org/git/20260825180350.2099-1-l.s.r@web.de/T/>\n\n> Please review the rest of the bug report below.\n> You can delete any lines you don't wish to share.\n> \n> \n> [System Info]\n> git version:\n> git version 2.55.0.windows.5\n> cpu: x86_64\n> built from commit: 32c4f7689275d233577576630e1ac5b7eb354eb0\n> sizeof-long: 4\n> sizeof-size_t: 8\n> shell-path: D:/git-sdk-64-build-installers/usr/bin/sh\n> rust: disabled\n> feature: fsmonitor--daemon\n> gettext: enabled\n> libcurl: 8.21.0\n> OpenSSL: OpenSSL 3.5.7 9 Jun 2026\n> zlib: 1.3.2\n> SHA-1: SHA1_DC\n> SHA-256: SHA256_BLK\n> default-ref-format: files\n> default-hash: sha1\n> uname: Windows 10.0 26200\n> compiler info: gnuc: 16.2\n> libc info: no libc information available\n> $SHELL (typically, interactive shell): C:\\Program Files\\Git\\usr\\bin\\bash.exe\n> \n> \n> [Enabled Hooks]\n> not run from a git repository - no hooks to show\n"}]}