All of lore.kernel.org
 help / color / mirror / Atom feed
* Add a git squash function?
@ 2026-08-16 18:49 The Super Techie
  2026-08-16 21:52 ` Matej Dujava
  0 siblings, 1 reply; 3+ messages in thread
From: The Super Techie @ 2026-08-16 18:49 UTC (permalink / raw)
  To: git

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:

git squash 3

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.

Has this been suggested before?

~thesupertechie



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Add a git squash function?
  2026-08-16 18:49 Add a git squash function? The Super Techie
@ 2026-08-16 21:52 ` Matej Dujava
  2026-08-16 23:38   ` Bradley Morgan
  0 siblings, 1 reply; 3+ messages in thread
From: Matej Dujava @ 2026-08-16 21:52 UTC (permalink / raw)
  To: The Super Techie; +Cc: git

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/pull.2337.v13.git.git.1786088371.gitgitgadget@gmail.com/
[1] https://lore.kernel.org/git/pull.2337.git.git.1781465141.gitgitgadget@gmail.com/

Thanks,
Matej

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Add a git squash function?
  2026-08-16 21:52 ` Matej Dujava
@ 2026-08-16 23:38   ` Bradley Morgan
  0 siblings, 0 replies; 3+ messages in thread
From: Bradley Morgan @ 2026-08-16 23:38 UTC (permalink / raw)
  To: mdujava; +Cc: git, thesupertechie1

Hi,

Yes, absolutely yes a squash function would be useful, anyone developing
it, please do.

I get annoyed with rebase headaches.

Thanks!

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-08-16 23:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-16 18:49 Add a git squash function? The Super Techie
2026-08-16 21:52 ` Matej Dujava
2026-08-16 23:38   ` Bradley Morgan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.