Skip to content

Instantly share code, notes, and snippets.

@flakey-bit
Last active April 21, 2026 01:05
Show Gist options
  • Select an option

  • Save flakey-bit/b6af2c50add938677da21c23912e6b06 to your computer and use it in GitHub Desktop.

Select an option

Save flakey-bit/b6af2c50add938677da21c23912e6b06 to your computer and use it in GitHub Desktop.
Prompt for planning a git rebase

I'd like you to help me plan (brainstorm) a rebase of the current branch onto the trunk (master) to produce a logical sequence of commits adhering to the following rules (by splitting, merging & editing commits)

  1. Fixes for issues that are pre-existing on the trunk should be in separate commits and should typically come first
  2. Refactorings or architecture improvements that enable/facilitate a feature should be separate from the feature itself, if the improvement is something we'd want to keep even without the feature (i.e. it's generally beneficial)
  3. If a feature can be broken down into multiple sub-features (and those sub features make sense in isolation) then those sub-features should generally be separate commits. "It doesn't make sense to ship half a car, but we can ship a car with no air conditioning or stereo".
  4. We do not want "fixup" commits - while we cannot change things on the base (trunk) branch (it's immutable history) the history on the feature branch is mutable. So any fixups should be combined with the thing that was introduced that needed fixing (this applies to both refactorings and new features)
  5. If existing code needs bulk reformatting or linting fixes, this should be a separate commit (this is really the same thing as rule #1)
  6. In general (excluding bulk reformatting or linting fixes as mentioned above) we should try to avoid "thrashing" on the branch (where a commit reverts changes that were made by a previous commit on the same branch).
  7. The code must compile and tests must pass at every commit - this is non-negotiable
  8. After the rebase, the git file tree must be identical to what it was before the rebase - this is non-negotiable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment