LMSouq
general-dev Open

"git submodule update" failed with 'fatal: detected dubious ownership in repository at...'

HU
Huihua Jiang
1 month ago
3 views
Problem Description
I mounted a new hard disk drive in my Linux workstation. It looks like it is working well. I want to download some repository in the new disk. So I execute `git clone XXX`, and it works well. But when I [cd][1] in the folder, and execute `git submodule update --init --recursive`. It failed with ``` fatal: detected dubious ownership in repository at '/media/data/users/jhu3szh/serialize' To add an exception for this directory, call: git config --global --add safe.directory /media/data/users/jhu3szh/serialize ``` I thought maybe it's just a slight warning, so I just executed `git config --global --add safe.directory /media/data/users/jhu3szh/serialize`. However, when I execute the Git submodule again, more similar errors came out. There are many submodules in the repository. What is the explanation for what happened? [1]: https://en.wikipedia.org/wiki/Cd_(command)

AI-Generated Solution

Powered by LMSouq AI · GPT-4.1-mini

✓ Solution Ready
Analyzing problem and generating solution…
Was this solution helpful?
Back to Knowledge Base