lazygit tips and tricks

August 12, 2024

lazygit tips and tricks

These are some tips and tricks for lazygit that I keep forgetting how to do.

Split a commit into multiple commits

Based on the discussion here.

  • Open lazygit
  • 4 to move to the commits panel
  • Enter key to select a commit to split
  • Use regular commands to stage and unstage parts you need.
  • Ctrl-P n to select “move to new commit”.
  • Write the commit message. Ctrl-O does not seem to work, so I usually put an arbitrary but memorable blurb, and reword the commit later.

The new commit will be put as a child of the one you just split.