jesseduffield/lazygit · warning

Feature not available for users using GPG. If you are using

Error message

Feature not available for users using GPG.

If you are using a passphrase agent (e.g. gpg-agent) so that you don't have to type your passphrase when signing, you can enable this feature by adding

git:
  overrideGpg: true

to your lazygit config file.

What it means

MovePatchIntoCommit refuses to run when config.NeedsGpgSubprocessForCommit() is true (commit signing configured and git.overrideGpg not set). The operation rewrites history via an interactive rebase that lazygit drives itself; it cannot answer a GPG passphrase prompt mid-flow, so it bails up front and the message explains the overrideGpg escape hatch.

Source

Thrown at pkg/commands/git_commands/patch.go:154

		self.rebase.onSuccessfulContinue = func() error {
			self.PatchBuilder.Reset()
			return nil
		}

		// continue
		return self.rebase.ContinueRebase()
	}

	if len(commits)-1 < sourceCommitIdx {
		return errors.New("index outside of range of commits")
	}

	// we can make this GPG thing possible it just means we need to do this in two parts:
	// one where we handle the possibility of a credential request, and the other
	// where we continue the rebase
	if self.config.NeedsGpgSubprocessForCommit() {
		return errors.New(self.Tr.DisabledForGPG)
	}

	baseIndex := sourceCommitIdx + 1

	changes := []daemon.ChangeTodoAction{
		{Hash: commits[sourceCommitIdx].Hash(), NewAction: todo.Edit},
		{Hash: commits[destinationCommitIdx].Hash(), NewAction: todo.Edit},
	}
	self.os.LogCommand(logTodoChanges(changes), false)

	err := self.rebase.PrepareInteractiveRebaseCommand(PrepareInteractiveRebaseCommandOpts{
		baseHashOrRoot: getBaseHashOrRoot(commits, baseIndex),
		overrideEditor: true,
		instruction:    daemon.NewChangeTodoActionsInstruction(changes),
	}).Run()
	if err != nil {
		return err
	}

View on GitHub (pinned to c477a2959b)

Solutions

  1. If a passphrase agent (gpg-agent/ssh-agent) supplies the passphrase non-interactively, add `git:\n overrideGpg: true` to lazygit config (~/.config/lazygit/config.yml)
  2. Otherwise temporarily disable signing for the operation: `git -c commit.gpgsign=false` equivalent via config, do the change, re-enable
  3. Ensure gpg-agent with cached passphrase is actually running before enabling overrideGpg, otherwise the rebase will hang on the prompt

Example fix

# before
# ~/.config/lazygit/config.yml (absent or overrideGpg unset)

# after
git:
  overrideGpg: true
Defensive patterns

Strategy: validation

Validate before calling

if gitCommands.Config.NeedsGpgSubprocessForCommit() && !appState.GetUserConfig().Git.OverrideGpg {
    return errors.New("enable git.overrideGpg (with gpg-agent) or disable signing to move patches")
}

Try / catch

Check NeedsGpgSubprocessForCommit() before offering the action in the UI (disable the menu entry), so the error never reaches the user; on catching DisabledForGPG, link the user to the overrideGpg config snippet.

Prevention

When it happens

Trigger: commit.gpgsign=true (or per-repo) with git.overrideGpg unset in lazygit config; using commit signing while trying to move a patch/hunk from one commit to another.

Common situations: Work machines with mandatory signing; users who enabled signing for a project then hit disabled features (reword, move patch, etc.).

Related errors


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