jesseduffield/lazygit · warning

Base commit is not in current view

Error message

Base commit is not in current view

What it means

Returned when candidate fixup base commits exist but their merged-status is CANNOT_TELL: the commit list loaded in the model is not enough to decide whether the base commits are already merged, which per the comment happens when a feature branch exceeds the ~300-commit model window or no main branch can be resolved. lazygit deliberately shows the generic message rather than a per-commit report because the case is rare.

Source

Thrown at pkg/gui/controllers/helpers/fixup_helper.go:103

	)

	// Group the hashes into buckets by merged status
	hashGroups := lo.GroupBy(hashes, func(hash string) int {
		commit, _, ok := self.findCommit(commits, hash)
		if ok {
			return lo.Ternary(commit.Status == models.StatusMerged, MERGED, NOT_MERGED)
		}
		return lo.Ternary(notFoundMeansMerged, MERGED, CANNOT_TELL)
	})

	if len(hashGroups[CANNOT_TELL]) > 0 {
		// If we have any commits that we can't tell if they're merged, just
		// show the generic "not in current view" error. This can only happen if
		// a feature branch has more than 300 commits, or there is no main
		// branch. Both are so unlikely that we don't bother returning a more
		// detailed error message (e.g. we could say something about the commits
		// that *are* in the current branch, but it's not worth it).
		return errors.New(self.c.Tr.BaseCommitIsNotInCurrentView)
	}

	if len(hashGroups[NOT_MERGED]) == 0 {
		// If all the commits are merged, show the "already on main branch"
		// error. It isn't worth doing a detailed report of which commits we
		// found.
		return errors.New(self.c.Tr.BaseCommitIsAlreadyOnMainBranch)
	}

	foundCommits := getCommitsForHashes(commits, hashGroups[NOT_MERGED])
	// If there are multiple commits that could be the base commit, remove all
	// those that are fixups for the last one.
	foundCommits = removeFixupCommits(foundCommits)

	if len(foundCommits) > 1 {
		// If there are still multiple commits that could be the base commit, list
		// them in the error message. But only the candidates from the current
		// branch, not including any that are already merged.

View on GitHub (pinned to c477a2959b)

Solutions

  1. Load more commits in the Commits panel (page down) so the base enters the model, then retry.
  2. Ensure the repo has a resolvable main branch and lazygit knows it (check branch status markers).
  3. Fall back to a manual 'git commit --fixup=<sha>' after finding the sha with git blame.
  4. Consider rebasing/splitting the oversized branch.
Defensive patterns

Strategy: fallback

Prevention

When it happens

Trigger: Invoking fixup on a change whose base commit falls outside the last 300 commits loaded into self.c.Model().Commits, or in a repo where the main branch cannot be determined so notFoundMeansMerged is false while commits are absent from the model.

Common situations: Very long-lived feature branches; monorepos with huge history; repos missing a master/main branch (e.g. only 'develop' or a custom default) so the merged heuristic has no anchor.

Related errors


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