Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows git error repository not owned #2074

Closed
shannonpileggi opened this issue Oct 23, 2024 · 1 comment
Closed

Windows git error repository not owned #2074

shannonpileggi opened this issue Oct 23, 2024 · 1 comment

Comments

@shannonpileggi
Copy link
Contributor

Hi! I am just sharing some new-to-me behavior on Windows in case it happens for other users.

I recently executed usethis::pr_init("xxx") and got the error

Error in libgit2::git_repository_open_ext :
   repository path '...' is not owned by current user

I then tried to check out a branch in the terminal and got a similar message:

❯ git checkout -b xxx
fatal: detected dubious ownership in repository at '...'
'...' is owned by:
        BUILTIN/Administrators (S-1-5-32-544)
but the current user is:
        MSKCC/myusername (S-1-12-1-3242423613-1154181413-1569470360-77695576)
To add an exception for this directory, call:

        git config --global --add safe.directory ...

The ... here suggested a specific project directory to add, which does work on a project by project basis. However, I followed this stack overflow post and added

[safe]
    directory = *

to my global .gitconfig

and now the problem has resolved and I am able to use {usethis} again for my PR workflows.

image

Feel free to close if this is not useful information.

@jennybc
Copy link
Member

jennybc commented Nov 25, 2024

I think this sounds like a rare enough issue (it's the first I've ever heard of it) that I don't see a clear call to action for usethis itself. Glad it is worked out!

@jennybc jennybc closed this as not planned Won't fix, can't repro, duplicate, stale Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants