Git development
 help / color / mirror / Atom feed
From: Tuomas Ahola <taahol@utu.fi>
To: Paul DE TEMMERMAN <p2trman@gmail.com>
Cc: <git@vger.kernel.org>
Subject: Re: [bug] git worktree add deletes my entire directory
Date: Tue, 8 Sep 2026 11:21:19 +0300	[thread overview]
Message-ID: <20260908082119.lw3hN%taahol@utu.fi> (raw)
In-Reply-To: <CAN=ULkdkRqnt_TP_pawiuuhod-_XVU=uDovYNMjbgQQ2jXQVpQ@mail.gmail.com>

Paul DE TEMMERMAN <p2trman@gmail.com> wrote:

> 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/>

> 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

      reply	other threads:[~2026-09-08  8:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-07 22:12 [bug] git worktree add deletes my entire directory Paul DE TEMMERMAN
2026-09-08  8:21 ` Tuomas Ahola [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260908082119.lw3hN%taahol@utu.fi \
    --to=taahol@utu.fi \
    --cc=git@vger.kernel.org \
    --cc=p2trman@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox