When I run git status
, git branch --track
, git fetch --all
, git pull --all
inside a git repository stored inside an Azure Blob Storage mapped to an Azure virtual machine with Windows 11 and Git for Windows version 2.37.3, I get the following error:
fatal: detected dubious ownership in repository at '<path>'
'<path>' is owned by:
'S-1-5-18'
but the current user is:
'S-1-5-21-1990399924-2863569968-2306271318-500'
To add an exception for this directory, call:
git config --global --add safe.directory '%(prefix)///<path>'
I have tested:
git config --global --add safe.directory '%(prefix)///<path>'
and
git config --global --add safe.directory '*'
and change directories and files permissions:
TAKEOWN /F * /R
But when I do all this in a local folder of the virtual machine everything works perfectly.