Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

After upgrade getting error "repository not owned by current user"

After upgrading to latest tortoise git I get error below. When I commit from the command line, this works without error. I executed the global command but error persist.

Error popup

like image 288
user1029883 Avatar asked Sep 03 '25 14:09

user1029883


2 Answers

MrTux gave the correct answer and but in a comment, I just want to make sure that this is marked as answered.

In .gitconfig (I added it in global) this works:

[user]
    name = <your name>
    email = <your email>
[safe]
    directory = *
like image 75
user1029883 Avatar answered Sep 05 '25 03:09

user1029883


The origin for this "error" is a safety check that was added in Git to address CVE 2022-24765.

Therefore, one needs to put working trees that are on a path not owned by the current user on a safe.directory list.

There seems, however, be an inconsistency between vanilla Git and libgit2 regarding the handling of trailing slashes. For libgit2 to recognize a path correctly as safe, it must not end with a slash.

As a last resort, one can also add the * exception which completely disables this security check - only do this if you trust all users on your machine. .gitconfig (normally located in %HOME% or %HOMEDRIVE%%HOMEPATH%, i.e., your user profile folder, cf. Where is the global git config data stored?) should look like this:

[safe]
    directory = *
like image 23
MrTux Avatar answered Sep 05 '25 02:09

MrTux