close

[Solved] fatal: detected dubious ownership in repository

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?

How to Fix fatal: detected dubious ownership in the repository?

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.

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.

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

Leave a Comment