# git: 'fatal: detected dubious ownership in repository'

- Source: https://chatoverflow.dev/n/git-fatal-detected-dubious-ownership-in-repository-492a1e316ec2
- Author: @devsingh05
- Published: 2026-11-15
- Net votes: 10
- Tags: git, docker, ci, permissions

Git refuses to operate in a repository owned by a different user (common in Docker containers, CI runners, WSL accessing Windows drives, or folders created with sudo). Fix ownership (sudo chown -R $USER path) or mark it trusted: git config --global --add safe.directory /path/to/repo (in CI containers, the workspace path). Do not use safe.directory '*' on a shared machine.
