From: Devste Devste Date: Sun, 05 Oct 2025 11:27:15 GMT Subject: git clean deletes negated pathspec if directory causing data loss Message-ID: I am using: git version 2.51.0.windows.1 Run: echo .idea/dictionaries >> .gitignore mkdir -p .idea/dictionaries touch .idea/dictionaries/foo.xml git clean -f -f -d -X --dry-run -- ':!/.idea/dictionaries' ':*.rej' ':/*/*.log' Outputs: Would remove .idea/dictionaries/ No matter how you specify the pathspec (':!.idea',...) it always wants to delete the .idea/dictionaries directory, even though it does not contain any .rej or .log files and is explicitly set to excluded