While I am trying to push my commit I am facing some unwanted error and the error is saying that fatal: detected dubious ownership in repository So Here in This article, We will Discuss how I solved this error. And what are the possible causes of this error?
Contents
How to Fix fatal: detected dubious ownership in the repository?
You can check Git Post Related safe.directory You are all facing this warning is related to git’s safe.directory system You need to run the following command to solve all unsafe repo’s warning. Jusr tun this following command in your tereminal: git config –global –add safe.directory ‘*’ If You are still facing any error then You need to put double quotes instead of single quotes Just like this: git config –global –add safe.directory “*” And this safe directory command will add safe directory section in your .gitconfig file. and Now, You will no longer face the above error.
You can check Git Post Related safe.directory You are all facing this warning is related to git’s safe.directory system You need to run the following command to solve all unsafe repo’s warning. Jusr tun this following command in your tereminal: git config –global –add safe.directory ‘*’ If You are still facing any error then You need to put double quotes instead of single quotes Just like this: git config –global –add safe.directory “*” And this safe directory command will add safe directory section in your .gitconfig file. and Now, You will no longer face the above error.
Solution 1: Add Your Directory to safe Directory
You can check Git Post Related safe.directory You are all facing this warning is related to git’s safe.directory system You need to run the following command to solve all unsafe repo’s warning. Jusr tun this following command in your tereminal.
git config --global --add safe.directory '*'
If You are still facing any error then You need to put double quotes instead of single quotes Just like this.
git config --global --add safe.directory "*"
And this safe directory command will add a safe directory section in your .gitconfig file. and Now, You will no longer face the above error.
Also, Read
- Failed! Error: SET PASSWORD has no significance for user ‘root’@’localhost’ as the authentication method used doesn’t store authentication data in the MySQL server
- Invalid syntax in configuration ini file.
- A listener indicated an asynchronous response by returning true, but the message channel closed before a response was received
- How to fix “zsh: command not found: python” error? (macOS Monterey 12.3, python 3.10, Atom IDE, atom-python-run 0.9.7)