Home > Enterprise >  Getting error "fatal: unsafe repository" even though I AM the owner of it
Getting error "fatal: unsafe repository" even though I AM the owner of it

Time:07-01

Before asking this here, I put some thinking into it, and maybe that happens because I added another SSH key to my profile.

I saw this error when I did git status in a repository that I have created before I add another SSH key.

So, what can I do to tell "it" that I am the owner of the repository?

The prompt, in case it is needed:

$ git status
fatal: unsafe repository ('C:/Users/#####/Desktop/workspace/DIO/Anotacoes' is owned by someone else)
To add an exception for this directory, call:

        git config --global --add safe.directory C:/Users/#####/Desktop/workspace/DIO/Anotacoes

CodePudding user response:

maybe that happens because I added another SSH key to my profile.

It should not be linked to SSH at all.
An SSH key is used to identify you on the remote server.
Your error message is because Git stops from accepting top-level directories owned by someone other than the current user.
Contexte: CVE-2022-24765

You can define the GIT_CEILING_DIRECTORIES environment variable to include your C:/Users/#####/Desktop/workspace/DIO/Anotacoes folder.

  • Related