Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Getting code 128: fatal: detected dubious ownership in repository

AhmedFarazSiddiqui
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 29, 2023

'git status' failed with code 128: fatal: detected dubious ownership in repository 'DIRECTORY PATH'

I have executed the command 
git config --global --add safe.directory 'DIRECTORY PATH'

The repository started working in the terminal, however, I'm still getting the error on Sourcetree UI.

3 answers

1 accepted

8 votes
Answer accepted
Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 30, 2023

Hello @AhmedFarazSiddiqui and thank you for reaching out to Atlassian Community!

I would suspect that Sourcetree is running git with a different user than the user you get in the terminal, which is causing the error to persist.

Since the --global flag only applies to the current user, I would suggest trying to use the --system flag with the '*' wildcard that will disable ownership verification for all the users and all the repositories : 

git config --system --add safe.directory '*' # For all users and all repositories

The wildcard '*' is only available for git version > 2.36

Before adding paths/repositories to the exception list, please make sure to understand the security implications of CVE-2022-24765 and setup_git_directory. This error is returned when the user that owns the local repository is different than the user executing the git command. To avoid this, it's strongly recommended for each user have their own clone of the repository. 

More details are available in the following article : 

Thank you, @AhmedFarazSiddiqui !

Patrik S

AhmedFarazSiddiqui
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 31, 2023

Thank you, for your assistance Patrik, was stuck with this for a while. 

Like # people like this
alvigod OP
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 12, 2023

thank you so much.

Like # people like this
taco turtle
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 16, 2024

worked for me. Thank you even if its years later. :)

Like Patrik S likes this
Ronald Blaas September 19, 2024

This didn't work for me. I have tried using --global or --system. 

 

I do see the setting set in the corresponding file but git (and sourcetree) still won't let me clone the repository

 

Jerome NKURUNZIZA November 9, 2024

Thank you!I would need to be answered the two other questions i asked.Thank you.

 

3 votes
dorota
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 25, 2024

Just Sourcetree Run as administrator

marcusobrien
Contributor
May 26, 2024

Yes this is the solution in Windows.

 

0 votes
Greg Stephenson
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 15, 2024

The fix for any users running Parallels on their Mac and hitting this error when Cloning to the Windows virtual machine is to change the default download location to their named Windows drive.

  1. Sourcetree will default to the shared Mac / Windows drive, something like C:\Mac\Home\Documents\[Repository name]
  2. You need to navigate to the Windows drive C:\Users\[Your username]\Documents\[Repository name]
Jerome NKURUNZIZA November 9, 2024

I need to know the 5 benefits of using this platform especially ways of gaing some money in using Trello.com.Thank you.

 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events