jesseduffield / lazygit

simple terminal UI for git commands
MIT License
53.65k stars 1.87k forks source link

Can't open lazygit #4060

Closed huhu415 closed 2 weeks ago

huhu415 commented 2 weeks ago

root@master:/home/zzyan/project/uaProxy# lazygit 2024/11/13 14:59:17 An error occurred! Please create an issue at: https://github.com/jesseduffield/lazygit/issues

*errors.errorString Error getting repo paths: 'git -C /home/zzyan/project/uaProxy rev-parse --show-toplevel --absolute-git-dir --git-common-dir --is-bare-repository --show-superproject-working-tree' failed: fatal: detected dubious ownership in repository at '/home/zzyan/project/uaProxy' To add an exception for this directory, call:

git config --global --add safe.directory /home/zzyan/project/uaProxy

/home/zzyan/go/pkg/mod/github.com/jesseduffield/lazygit@v0.44.1/pkg/commands/git.go:65 (0xa134e9) NewGitCommand: return nil, errors.Errorf("Error getting repo paths: %v", err) /home/zzyan/go/pkg/mod/github.com/jesseduffield/lazygit@v0.44.1/pkg/gui/gui.go:306 (0xbab4d8) (Gui).onNewRepo: gui.git, err = commands.NewGitCommand( /home/zzyan/go/pkg/mod/github.com/jesseduffield/lazygit@v0.44.1/pkg/gui/gui.go:833 (0xbaf4bb) (Gui).Run: if err := gui.onNewRepo(startArgs, context.NO_CONTEXT); err != nil { /home/zzyan/go/pkg/mod/github.com/jesseduffield/lazygit@v0.44.1/pkg/gui/gui.go:852 (0xbaf9c5) (Gui).RunAndHandleError.func1: if err := gui.Run(startArgs); err != nil { /home/zzyan/go/pkg/mod/github.com/jesseduffield/lazygit@v0.44.1/pkg/utils/utils.go:99 (0x889916) SafeWithError: err := f() /home/zzyan/go/pkg/mod/github.com/jesseduffield/lazygit@v0.44.1/pkg/gui/gui.go:851 (0xbaf90e) (Gui).RunAndHandleError: return utils.SafeWithError(func() error { /home/zzyan/go/pkg/mod/github.com/jesseduffield/lazygit@v0.44.1/pkg/app/app.go:270 (0xc0bb76) Run: err := app.Gui.RunAndHandleError(startArgs) /home/zzyan/go/pkg/mod/github.com/jesseduffield/lazygit@v0.44.1/pkg/app/app.go:48 (0xc0bb26) Run: err = app.Run(startArgs) /home/zzyan/go/pkg/mod/github.com/jesseduffield/lazygit@v0.44.1/pkg/app/entry_point.go:167 (0xc0dd3c) Start: Run(appConfig, common, appTypes.NewStartArgs(cliArgs.FilterPath, parsedGitArg, integrationTest)) /home/zzyan/go/pkg/mod/github.com/jesseduffield/lazygit@v0.44.1/main.go:23 (0xc0eed8) main: app.Start(ldFlagsBuildInfo, nil) /usr/local/go/src/internal/runtime/atomic/types.go:194 (0x43de2b) (*Uint32).Load: return Load(&u.value) /usr/local/go/src/runtime/asm_amd64.s:1700 (0x47c6e1) goexit: BYTE $0x90 // NOP root@master:/home/zzyan/project/uaProxy# git config --global --add safe.directory /home/zzyan/project/uaProxy root@master:/home/zzyan/project/uaProxy#

mark2185 commented 2 weeks ago

Is the owner of the repo non-root perhaps? E.g. zzyan?

The error message states:

failed: fatal: detected dubious ownership in repository at '/home/zzyan/project/uaProxy'

It means that git won't work either, so it's not lazygit's fault. Either don't launch lazygit as root, or add it to the list of safe directories.

huhu415 commented 2 weeks ago

fine, you are right