jesseduffield/lazygit · critical

Git version must be at least %s. Please upgrade your git ver

Error message

Git version must be at least %s. Please upgrade your git version.

What it means

Thrown by App.validateGitVersion at lazygit startup: the detected git version is older than the hard minimum 2.32.0, or the version could not be detected at all (any error from git_commands.GetGitVersion is collapsed into the same message). Lazygit requires 2.32+ because it relies on features such as the sequencer/todo behaviors introduced around that release.

Source

Thrown at pkg/app/app.go:153

	}

	app.Gui, err = gui.NewGui(common, config, gitVersion, updater, showRecentRepos, dirName, test)
	if err != nil {
		return app, err
	}
	return app, nil
}

const minGitVersionStr = "2.32.0"

func minGitVersionErrorMessage(tr *i18n.TranslationSet) string {
	return fmt.Sprintf(tr.MinGitVersionError, minGitVersionStr)
}

func (app *App) validateGitVersion() (*git_commands.GitVersion, error) {
	version, err := git_commands.GetGitVersion(app.OSCommand)
	// if we get an error anywhere here we'll show the same status
	minVersionError := errors.New(minGitVersionErrorMessage(app.Tr))
	if err != nil {
		return nil, minVersionError
	}

	minRequiredVersion, _ := git_commands.ParseGitVersion(minGitVersionStr)
	if version.IsOlderThanVersion(minRequiredVersion) {
		return nil, minVersionError
	}

	return version, nil
}

func isDirectoryAGitRepository(dir string) (bool, error) {
	info, err := os.Stat(filepath.Join(dir, ".git"))
	return info != nil, err
}

func openRecentRepo(app *App) bool {

View on GitHub (pinned to c477a2959b)

Solutions

  1. Upgrade git to >= 2.32.0 (e.g. `brew install git`, apt/backport, or use a newer base image)
  2. Verify `git --version` in the same shell/environment lazygit runs in and that it resolves to the binary you expect (`which git`)
  3. If a wrapper script intercepts git, make it pass through `--version` output unchanged or remove it from PATH for lazygit

Example fix

# before
$ lazygit
Git version must be at least 2.32.0. Please upgrade your git version.

# after
$ brew install git   # or: apt install git / use a newer image
$ git --version
git version 2.45.1
$ lazygit
Defensive patterns

Strategy: validation

Validate before calling

out, err := exec.Command("git", "--version").Output()
if err != nil {
    // git missing/broken: fail before launching lazygit
    log.Fatal("git not usable: ", err)
}
v, _ := git_commands.ParseGitVersion(strings.TrimSpace(string(out)))
min, _ := git_commands.ParseGitVersion("2.32.0")
if v.IsOlderThanVersion(min) {
    log.Fatalf("git >= 2.32.0 required, found %s", v)
}

Try / catch

When embedding lazygit's App setup, treat validateGitVersion's error as fatal and surface it to the user with an upgrade instruction rather than retrying — version detection failure and an old version are indistinguishable by design.

Prevention

When it happens

Trigger: Running lazygit with git < 2.32.0 on PATH; having a shim/wrapper named git that prints non-version output so parsing fails; a broken git install where `git --version` errors; a container/CI image shipping an old git (e.g. Debian buster, old Alpine).

Common situations: Old LTS Linux distros, minimal Docker images, macOS with Xcode CommandLineTools git shadowing a Homebrew git, Windows where git is not on PATH at all (GetGitVersion errors are reported the same way).

Related errors


AI-assisted analysis of jesseduffield/lazygit@c477a2959b (2026-08-15). Data as JSON: /api/errors/11a7e07dc24618c4. Report an issue: GitHub.