TLDR;

Lazygit simplifies the fixup commit and squash process by the following keybinding:

  • F create fixup commit - create a new !fixup commit with your current changes (these fixup changes will be used later by the auto squash)
  • S autosquash - squashes all the !fixup commits above the selected commit into their respective target commits

Fixup vs Squash

The difference between squash and fixup, is that squash let’s you edit the resulting commit log message; fixup, on the other hand, defaults to using the previous commit’s log message.

  • squash: Combines multiple commits and presents you with an editor to create a single, consolidated commit message from the messages of all the squashed commits.
  • fixup: Combines multiple commits but automatically discards the commit message of the fixup commits, keeping only the message of the base commit you are merging into. This is ideal for minor corrections or “fixup!” changes you don’t want in the final history.

(*However, so far as I trial in Lazygit, I don’t seem to be able to tell the difference; Using s squash shortcut does not prompt me to enter the commit message; Potentially this is because I am not yet combining it with feature such as rebase … ?)

Lazygit Fixup Commit & Auto-Squash

In lazygit you can create commit with message of prefix !fixup (using shortcut F) to denote a commit is a fixup commit of certain “root/source” commit, and later use the auto-squash to combine all the !fixup commits to their corresponding “root/source” commit.

For instance:

  1. we have a root commit 542f4e0f of message button feature (here I’m just using a demo repo, so the commit message may be a bit casual)

    2026-01-15T105841

  2. we’re adding two extra changes to the button (for simplicity just adding two string); And creating two fixup commits (which adds the prefix !fixup to the last commit message)

    2026-01-15T105903

  3. finally we use the auto-squash feature in lazygit, to merge the two fixup commits we just created to the base commit 542f4e0f

    2026-01-15T110455

  4. similarly, you can use the !amend option to change the 542f4e0f base commit’s message during the auto-squash (remember to select the base commit before you press the F shortcut)

    2026-01-15T110847

Undo / Redo

The following keybindings in Lazygit utilising git reflog + git reset --hard <previous-ref> are also very useful in case you break something during the process (see: lazygit undo/redo)

  • z undo - undo the last action
  • <c-z> redo - redo the last action

2026-01-15T105008


Reference