You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
safe.directory interpretation is case-sensitive on Windows for the drive letter, when it is not for Git for Windows. #7037
On Windows 11, create a repository and assign ownership to something other than the current user. (I use the BUILTIN\Users group to repro, since the ownership check does not resolve group memberships other than BUILTIN\Administrators).
Running "git status" (git for windows 2.47.1) in the repository results in fatal: detected dubious ownership in repository at 'C:/path/to/repo' 'C:/path/to/repo' is owned by: BUILTIN/Users (S-1-5-32-545) but the current user is: <redacted>
Using libgit2sharp (0.31.0) to open the repository (Repository r = new Repository(@"C:\path\to\repo");) results in LibGit2Sharp.LibGit2SharpException: 'repository path 'C:/path/to/repo' is not owned by current user'
Add the path with a case mismatch to safe.directory git config --global --add safe.directory c:/PATH/to/REPO
git status now works
Opening the repo with Libgit2sharp still results in LibGit2Sharp.LibGit2SharpException: 'repository path 'C:/path/to/repo' is not owned by current user'
Opening the repo with matching case on the drive letter (Repository r = new Repository(@"c:\path\to\repo"); works as expected - the path is case-insensitive, but the drive letter is case-sensitive.
changed the title [-]safe.directory interpretation is case-sensitive on Windows, when it is not for Git for Windows.[/-][+]safe.directory interpretation is case-sensitive on Windows for the drive letter, when it is not for Git for Windows.[/+]on Feb 7, 2025
Activity
[-]safe.directory interpretation is case-sensitive on Windows, when it is not for Git for Windows.[/-][+]safe.directory interpretation is case-sensitive on Windows for the drive letter, when it is not for Git for Windows.[/+]ethomson commentedon Mar 3, 2025
What's amazing about this is that
safe.directoryis case sensitive on macOS, so this is not actually honoringcore.ignorecase.safe.directoryis an unmitigated disaster.csware commentedon May 24, 2026
Even if safe.directory is a desaster, libgit2 should not ignore issues...