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

"failed: fatal: detected dubious ownership in repository" when running lazygit on a newly initialized repository on a external drive #3757

Open
bornacvitanic opened this issue Jul 17, 2024 · 0 comments · May be fixed by #3881
Labels
bug Something isn't working

Comments

@bornacvitanic
Copy link

Describe the bug
When trying to run lazygit on a newly initialized repository on an external drive it throws a fatal error. A similar error with a suggested command to run is shown when manually running 'git status' aswell. Running the suggested command fixes the issue.

Console Log:
_PS F:\RustProjects\Practice\documentation_generator> git init
PS F:\RustProjects\Practice\documentation_generator> lazygit
2024/07/17 20:33:34 An error occurred! Please create an issue at: https://github.com/jesseduffield/lazygit/issues

*errors.errorString 'git -C F:\RustProjects\Practice\documentation_generator rev-parse --path-format=absolute --show-toplevel --absolute-git-dir --git-common-dir --is-bare-repository --show-superproject-working-tree' failed: fatal: detected dubious ownership in repository at 'F:/RustProjects/Practice/documentation_generator'
'F:/RustProjects/Practice/documentation_generator' is on a file system that does not record ownership
To add an exception for this directory, call:

    git config --global --add safe.directory F:/RustProjects/Practice/documentation_generator

/home/runner/work/lazygit/lazygit/pkg/commands/git_commands/repo_paths.go:147 (0x11017b8)
/home/runner/work/lazygit/lazygit/pkg/commands/git_commands/repo_paths.go:91 (0x1100f88)
/home/runner/work/lazygit/lazygit/pkg/commands/git_commands/repo_paths.go:83 (0x1100e4c)
/home/runner/work/lazygit/lazygit/pkg/app/app.go:123 (0x13103f5)
/home/runner/work/lazygit/lazygit/pkg/app/app.go:45 (0x130fcb8)
/home/runner/work/lazygit/lazygit/pkg/app/entry_point.go:161 (0x1311ef7)
/home/runner/work/lazygit/lazygit/main.go:23 (0x1313858)
/opt/hostedtoolcache/go/1.22.5/x64/src/runtime/internal/atomic/types.go:194 (0xb820eb)
/opt/hostedtoolcache/go/1.22.5/x64/src/runtime/asm_amd64.s:1695 (0xbb8d81)

PS F:\RustProjects\Practice\documentation_generator> git status
fatal: detected dubious ownership in repository at 'F:/RustProjects/Practice/documentation_generator'
'F:/RustProjects/Practice/documentation_generator' is on a file system that does not record ownership
To add an exception for this directory, call:

    git config --global --add safe.directory F:/RustProjects/Practice/documentation_generator

PS F:\RustProjects\Practice\documentation_generator> git config --global --add safe.directory F:/RustProjects/Practice/documentation_generator_

To Reproduce
Steps to reproduce the behavior:

  1. Initialize a new git repository on a external drive (SSDwith exFat partition to be precise) using 'git init'
  2. Try to run lazygit in the same repo. It throws a fatal error.

Expected behavior
I would expect lazygit to run normally but throw that error as a popup dialog explaining the problem and offering two options: to run the suggested command or to quit.

Version info:
commit=71ad3fac63a3ef3326021837b49e9497d332818b, build date=2024-07-13T10:24:19Z, build source=binaryRelease, version=0.43.1, os=windows, arch=amd64, git version=2.44.0.windows.1
git version 2.44.0.windows.1

@bornacvitanic bornacvitanic added the bug Something isn't working label Jul 17, 2024
@Kapparina Kapparina linked a pull request Sep 1, 2024 that will close this issue
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant