Repository navigation
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
- First time user and install of lazygit
- Install was simple... smooth, but got an error upon initial launch within a repo directory
To Reproduce
- immediately after install, I changed to a repo directory
- running
lazygitalone produced an error with instructions to log this error
$ sudo apt install lazygit
Installing:
lazygit
Summary:
Upgrading: 0, Installing: 1, Removing: 0, Not Upgrading: 8
Download size: 6,935 kB
Space needed: 25.0 MB / 32.1 GB available
Get:1 https://esm.ubuntu.com/apps/ubuntu resolute-apps-security/main amd64 lazygit amd64 0.57.0+ds1-1ubuntu0.26.04.1~esm1 [6,935 kB]
Fetched 6,935 kB in 2s (4,334 kB/s)
Selecting previously unselected package lazygit.
(Reading database… 321567 files and directories currently installed.)
Preparing to unpack …/lazygit_0.57.0+ds1-1ubuntu0.26.04.1~esm1_amd64.deb…
Unpacking lazygit (0.57.0+ds1-1ubuntu0.26.04.1~esm1)…
Setting up lazygit (0.57.0+ds1-1ubuntu0.26.04.1~esm1)…
Processing triggers for man-db (2.13.1-1build1)…
$ lazygit
Not in a git repository. Create a new git repository? (y/N): n
Must open lazygit in a git repository. No valid recent repositories. Exiting.
$ cd /opt/my-project
$ lazygit
2026/10/15 08:47:19 An error occurred! Please create an issue at: https://github.com/jesseduffield/lazygit/issues
*errors.errorString Error getting repo paths: 'git -C /opt/my-project 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 '/opt/my-project'
To add an exception for this directory, call:
git config --global --add safe.directory /opt/my-project
github.com/jesseduffield/lazygit/pkg/commands/git.go:67 (0x5d87a22cc5b1)
github.com/jesseduffield/lazygit/pkg/gui/gui.go:323 (0x5d87a2461a25)
github.com/jesseduffield/lazygit/pkg/gui/gui.go:864 (0x5d87a246682f)
github.com/jesseduffield/lazygit/pkg/gui/gui.go:885 (0x5d87a2466d88)
github.com/jesseduffield/lazygit/pkg/utils/utils.go:80 (0x5d87a204f496)
github.com/jesseduffield/lazygit/pkg/gui/gui.go:884 (0x5d87a2466cb6)
github.com/jesseduffield/lazygit/pkg/app/app.go:277 (0x5d87a24c6c5a)
github.com/jesseduffield/lazygit/pkg/app/app.go:48 (0x5d87a24c6bea)
github.com/jesseduffield/lazygit/pkg/app/entry_point.go:177 (0x5d87a24c8f50)
github.com/jesseduffield/lazygit/main.go:19 (0x5d87a24ca27f)
internal/runtime/atomic/types.go:194 (0x5d87a1c80735)
runtime/asm_amd64.s:1771 (0x5d87a1cbfa01)
Expected behavior
Launch lazygit in my terminal inside a git repository directory without any errors after initial install.
Screenshots
n/a
Version info:
$ lazygit --version
commit=, build date=, build source='debian', version='0.57.0+ds1-1ubuntu0.26.04.1~esm1', os=linux, arch=amd64, git version=2.53.0
Terminal info:
Ubuntu 26.04.1 LTS
GNU bash, version 5.3.9(1)-release (x86_64-pc-linux-gnu)
Additional context
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Activity
stefanhaller commentedon Oct 15, 2026
This doesn't look like a lazygit problem (except that it could maybe be better at recognizing this error and not ask you to file an issue about it 😄). I bet if you cd into that directory and type something like
git statusorgit log, you'll get the same error.It's an ownership issue, as the error message tells you. Searching google for the error message turns up lots of explanations; here's one.
BTW, you have installed a rather old version of lazygit; do yourself a favor and install the latest one, it's much improved.
TechStud commentedon Oct 16, 2026
You're correct... it doesn't, but I raised the issue because the output suggested it. Maybe it was a reminder for better recognition / handling of the error? Not sure, but I did end up reviewing and following your suggested call
git config --global --add safe.directory /opt/my-projectwhich was successful.Wait, I
installed a rather old version of lazygit? Huh...sudo apt install lazygitwas used to install it about 5 mins earlier.Let me confirm...
Looks like I'm currently using the latest version available via Ubuntu's official package streams. If you already pushed the latest release, I look forward to the update once it's available.
stefanhaller commentedon Oct 17, 2026
Ubuntu (like Debian, which it is based on) generally doesn't carry the latest versions of its software packages. It is their philosophy to keep things "stable" (I personally find this crazy). If you want a Linux distribution that has the latest versions of all the software you use, then Ubuntu is not for you.
I'd install lazygit manually, as shown here.
A quick google search turned up https://deb.griffo.io/install-latest-lazygit-in-ubuntu.html, which may also be helpful.