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.

MACMAN
  • 1,883
  • 1
  • 21
  • 35
  • 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](https://stackoverflow.com/q/71891061/1256452) for instance. – torek Apr 16 '22 at 05:07
  • Thank you for this information. It helped. – MACMAN Apr 20 '22 at 02: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](https://stackoverflow.com/questions/71891061/git-has-stopped-working-after-installing-vs-2022). – Mathador Apr 20 '22 at 08: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 '22 at 04: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 '22 at 20:08

3 Answers3

6

(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.

Abdelrahman Shoman
  • 2,882
  • 7
  • 36
  • 61
1

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.

Dusky5
  • 11
  • 1
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.

MACMAN
  • 1,883
  • 1
  • 21
  • 35
  • 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 '22 at 07:27