7

I have a git repository as a mapped network on my machine on my "Y:" drive. Until recently I was able to connect to the repository from my git desktop application. But for the last two days it throws an error

"GIT Repository appears to be owned by another user on your machine"

What could be possible cause for this error.

5
  • 3
    Git has recently (due to a CVE) started caring about repository ownership: if you don't own some repository, the person who does can set that repository up to steal your privileges via a Trojan-horse. The new "don't trust" code can be overly paranoid for some people in some situations so it's configurable. See this question for instance.
    – torek
    Apr 16, 2022 at 5:07
  • Thank you for this information. It helped.
    – MACMAN
    Apr 20, 2022 at 2:54
  • 1
    @MACMAN, how did you solve the issue in the end? I currently have the same problem on Windows but I did not find a solution so far, also with the hints given in the question mentioned above.
    – Mathador
    Apr 20, 2022 at 8:53
  • I installed Git desktop in my ubuntu machine and manage my local ubuntu repository from the ubuntu machine itself. Now I no longer depend on shared folder.
    – MACMAN
    Apr 21, 2022 at 4:51
  • 1
    My Visual Studio git no longer detects changes in my code. I added the local repository in Github Desktop then I got the above message. I added as dir exception and it works. However Visual Studio git still isn't working. This happens yesterday when I;d update Visual Studio.
    – hubert17
    May 12, 2022 at 20:08

3 Answers 3

8

(Using Windows and GitHub Desktop. Also Not using a shared folder)

Not sure if this could help anyone.

I got this message and it seemed weird to me as I previously managed to add other repositories similar to the one I was facing an issue with. Also, I was not using a shared folder.

Turns out, I only needed to open GitHub Desktop as an Admin.

1
  • 2
    Turns out, I only needed to open GitHub Desktop as an Admin. This is the answer!
    – DanielV
    Jun 28 at 10:14
2

If it still doesn't work, even if you ran Github Desktop as administrator, you need to add your repository as a secure directory in the (.gitconfig) file.

If you don't have [safe] in your (.gitconfig) you have to add the following: [safe] directory = [directory path]

However, you still have to keep in mind that backslashes do not work.

0

I solved this issue myself by installing Git desktop in my ubuntu machine and managing my local ubuntu repository from the ubuntu machine itself. Now I no longer depend on shared folder.

1
  • 3
    Ok, thanks for the response. For those using windows and GitHub Desktop, there is since yesterday the possibility to add an exception for a git repository located on a shared network, which solved my issue.
    – Mathador
    Apr 21, 2022 at 7:27

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.