jesseduffield/lazygit · error

You should have an allBranchesLogCmds defined as a sequence!

Error message

You should have an allBranchesLogCmds defined as a sequence!

What it means

Thrown during the git.allBranchesLogCmd -> git.allBranchesLogCmds config migration in pkg/config/app_config.go:507. After locating the existing allBranchesLogCmds node, its YAML node Kind is not a SequenceNode — i.e. the user's config has allBranchesLogCmds as a scalar or mapping instead of a list — so the old scalar value cannot be prepended into it.

Source

Thrown at pkg/config/app_config.go:507

			return nil
		}

		cmdsKeyNode, cmdsValueNode := yaml_utils.LookupKey(gitNode, "allBranchesLogCmds")
		var change string
		if cmdsKeyNode == nil {
			// Create empty sequence node and attach it onto the root git node
			// We will later populate it with the individual allBranchesLogCmd record
			cmdsKeyNode = &yaml.Node{Kind: yaml.ScalarNode, Value: "allBranchesLogCmds"}
			cmdsValueNode = &yaml.Node{Kind: yaml.SequenceNode, Content: []*yaml.Node{}}
			gitNode.Content = append(
				gitNode.Content,
				cmdsKeyNode,
				cmdsValueNode,
			)
			change = "Created git.allBranchesLogCmds array containing value of git.allBranchesLogCmd"
		} else {
			if cmdsValueNode.Kind != yaml.SequenceNode {
				return errors.New("You should have an allBranchesLogCmds defined as a sequence!")
			}

			change = "Prepended git.allBranchesLogCmd value to git.allBranchesLogCmds array"
		}

		if cmdValueNode.Value != "" {
			// Prepending the individual element to make it show up first in the list, which was prior behavior
			cmdsValueNode.Content = utils.Prepend(cmdsValueNode.Content, &yaml.Node{Kind: yaml.ScalarNode, Value: cmdValueNode.Value})
			changes.Add(change)
		}

		// Clear out the existing allBranchesLogCmd, now that we have migrated it into the list
		_, _ = yaml_utils.RemoveKey(gitNode, "allBranchesLogCmd")
		changes.Add("Removed obsolete git.allBranchesLogCmd")

		return nil
	})
}

View on GitHub (pinned to c477a2959b)

Solutions

  1. Edit ~/.config/lazygit/config.yml and make git.allBranchesLogCmds a YAML sequence, e.g. 'allBranchesLogCmds:\n - git log ...'
  2. Or remove git.allBranchesLogCmds entirely and keep only the old allBranchesLogCmd so the migration creates the sequence itself
  3. Validate the file parses as intended with a YAML linter, then restart lazygit

Example fix

# before (config.yml)
git:
  allBranchesLogCmd: git log --graph --all
  allBranchesLogCmds: git log --graph --all  # scalar: triggers error

# after
git:
  allBranchesLogCmds:
    - git log --graph --all --color=always
Defensive patterns

Strategy: validation

Validate before calling

# Pre-validate before launch: every allBranchesLogCmds must be a YAML sequence
git -c alias.check='!f() { yq ".git.allBranchesLogCmds | type == \"!!seq\"" ~/.config/lazygit/config.yml; }; f' check

Prevention

When it happens

Trigger: A user config where 'git: allBranchesLogCmds:' is defined as a string (e.g. copied from old docs that used the singular key with a plural list key name) or as a nested map, combined with also having allBranchesLogCmd set, triggering the migration path that requires a sequence.

Common situations: Hand-edited config.yml where the plural key was given a scalar value; configs shared between lazygit versions; snippets pasted from outdated documentation.

Related errors


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