Re: Add a git squash function?

Matej Dujava <[email protected]>
Newsgroups org.kernel.vger.git
Message-ID <[email protected]>
On Sun, Aug 16, 2026 at 11:49:50AM -0700, The Super Techie wrote:
>Hi,

Hi,

>
>I am a developer who often squashes their commits using Git. 
>Currently, the simplest way to squash is to run the following two 
>commands:
>
>git reset --soft HEAD~3
>
>git commit
>
>Where 3 is the number of commits that a user would like to squash. 
>However, what if there was a command like as follows:
>
>Which did the same thing? This would save quite a bit of time for 
>developers. Since some projects require the DCO, an -s flag could be 
>added which would add a sign-off to the squashed commit as well.

when later commits are adressing feedback you can do fixup! or squash!
commits and then cleanup before merge: `git rebase --autosquash HEAD~3`

>
>Has this been suggested before?

Looks like there is a v13 [0] patchset discussing similar worflow, which
started as [1].

>
>git squash 3

suggested command was `git history squash HEAD~3` but this will keep
message of the fist commit


[0] https://lore.kernel.org/git/[email protected]/
[1] https://lore.kernel.org/git/[email protected]/

Thanks,
Matej
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.