Skip to content

Is it possible to squash randomly selected commits? #3424

@pentago

Description

@pentago

Is your feature request related to a problem? Please describe.

I, and probably lots of other people, occasionally need to squash/fixup commits that are not directly one below another and would appreciate it if we could select random commits to squash/fixup.

Describe the solution you'd like:

Instead of allowing to squash/fixup only commits that are directly one below another in history, I'd like to be able to squash/fixup random commits.

For example, consider this scenario:
image

Let's say I only want to squash/fixup only commits YYY and WWW to Init.

I'm not sure how would I do it, perhaps there's an existing lazygit workflow that just isn't that obvious, or at least my understanding of git features and terminology makes me unsure which I could use to achieve the goal.

If my request is not sufficient for a new feature, at least I'd appreciate instructions on how to achieve the same with the existing feature set.

I just thought that it would be great if we could:

  1. hit v to select commits to squash
  2. hit c-f (to define target commit in a popup)
  3. hit enter to perform squash or fixup

Describe alternatives you've considered
N/A

Additional context
N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions