The error means the user running Git does not own the repository directory, and since Git 2.35.2 Git refuses to run there as a security measure. The quick fix is git config --global --add safe.directory <path> , but in containers and CI the better fix is usually to make the UIDs match, and a blanket safe.directory '*' is only acceptable on throwaway machines.
What does the error actually look like?
fatal: detected dubious ownership in repository at '/workspace' To add an exception for this directory, call:
git config --global --add safe.directory /workspace
Enter fullscreen mode
Exit fullscreen mode
You tend to meet it in four places: a bind-mounted source directory inside Docker, a CI job that runs inside a container image, a repo checked out by one user and used by another (a deploy user versus root, say), and network or Windows-shared drives.…