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.
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 = *
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 = *
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With