question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

fatal: unsafe repository ('' is owned by someone else)

See original GitHub issue

Does this issue occur when all extensions are disabled?: Yes/No

  • VS Code Version: 1.67
  • OS Version: Win 21H2

Steps to Reproduce:

  1. Use the openRepository command to open a repo that is not added to ‘safe.directory’
  2. reference: https://github.com/microsoft/vscode/commit/6b241a6845d17992a5a754d5eaf32fd1824ef74e
  3. There is a caught exception that states the following
'fatal: unsafe repository ('' is owned by someone else)
To add an exception for this directory, call:

	git config --global --add safe.directory 

Obviously, for security purposes, an extension wouldn’t want to just add this value for the user, so it would be nice to provide the same dialog that vsCode uses (though for a different purpose), that asks the user if they want to trust the repository.

You could certainly say that this is not a vsCode issue and that such a dialog shouldn’t be handled internally by vscode, and I wouldn’t be able to argue. In the meantime, I would probably look into prompting the user for trust and then use ‘child_process’ to exec git config global’ Could you at least point me to where I can pick up the error without just debugging all “CaughtExceptions”?

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:16
  • Comments:9

github_iconTop GitHub Comments

5reactions
msftrncscommented, Jun 4, 2022

VS Code needs to at least acknowledge the unsafe repository status from GIT instead of indicating ‘no repository here, make one?’, when making one still won’t work.

3reactions
jamepercommented, May 16, 2022

I downgraded from VS Enterprise 2022 to VS Professional 2022 and I get this error. Running my new version of VS as Administrator fixed this issue for me

Read more comments on GitHub >

github_iconTop Results From Across the Web

git - Fatal error "unsafe repository ('/home/repon' is owned by ...
you will get this error, so make sure you have appropriate directory permission. You can change the directory ownership by running chown or...
Read more >
Solution to GIT: "unsafe repository ('some-repo' is owned by ...
This post looked at what causes the unsafe repository ('some-repo' is owned by someone else) Git error. We said that this error occurs...
Read more >
Unsafe repository (REPO) is owned by someone else
Create a .gitconfig file in /var/www directory, which is the home for www-data user, with the following content : ¡ Add the folder...
Read more >
`fatal: unsafe repository (REPO is owned by someone ... - GitHub
This issue seems only happens for workflows based on docker container, workflows directly running on runners is not affected. git config -- ...
Read more >
Git: Unsafe repository is owned by someone else (Windows)
Git: Unsafe repository is owned by someone else (Windows) · Open Windows “Explorer” and go to the repository where the error occurred ·...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found