dev@local: ~/project — git
dev@local~/project$git status
fatal: dubious ownership
To add an exception for this directory, call:
git config --global --add safe.directory /project
Diagnostics Translation
Git refused to run because the repository folder is owned by a different system user.
waiting for resolution...
MediumVersion Control System
Reviewed for reference consistency: April 11, 2026
Data Loss Risk
HIGH RISKGit stopped to prevent overriding unsaved work. Do not force commands without stashing or committing first.
What To Know
This state means Git sees a filesystem ownership mismatch large enough to treat the repository as untrusted until the directory is explicitly accepted.
Where Did It Fail?
Working Tree
Your local files
add
Staging Index
Prepared changes
commit
Local Repo
Commit history
push/fetch
Remote Server
GitHub/GitLab
Git halted to protect the uncommitted files in your active working directory.
Commands That Trigger This
$Opening a project in VS Code via WSL and finding that Git integration is completely broken
Opening a project in VS Code via WSL and finding that Git integration is completely broken
$A CI/CD pipeline script failing when a Docker container tries to check out code
A CI/CD pipeline script failing when a Docker container tries to check out code
Technical Background
01
If an attacker can place a malicious `.git/config` file in a shared directory, they could trick your Git client into executing arbitrary commands with your user privileges.
02
Git enforces this check globally. If the ownership mismatch is intentional (like in Docker/WSL setups), the directory must be explicitly added to the `safe.directory` config list.
Underlying Causes
Running Git inside a Docker container mounted to a host directory
Using WSL (Windows Subsystem for Linux) on a Windows NTFS file system
Running a Git command using `sudo` or as the `root` user
Frequently Asked Questions
Only if you completely trust the directory and the users who have write access to it (e.g., it is your own local development environment).