I mounted a new hdd in my linux workstation. It looks working well. I want to download some repo in the new disk. So I execute git clone XXX, and it works well. But when I cd 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 repo.
Can someone give me some explanation what happened? I searched the error information in google, but I can hardly get useful information. Thanks in advance.
chmodif you can; unfortunately without restoring from backup, that's generally difficult). The complaint instead has to do with ownership, i.e., the user-ID who owns each of the various directories.sudoif at all possible), or bypass the security (but if you do that, you're taking some level of risk as shown by the CVE's existence). To fix the ownership of existing repositories, usechownto change their ownership to the correct owner. Of course this requires the use ofsudo—but at least you can use it just once, to fix this condition, and then stop using it...*as a "safe" directory (note that this requires a Git version that supports*; 2..36 or later does, for instance).