Repository navigation
history: squash the commits not in the upstream by default - #2463
Draft
HaraldNordgren wants to merge 1 commit into
Draft
HaraldNordgren wants to merge 1 commit into
HaraldNordgren wants to merge 1 commit into
Conversation
HaraldNordgren
force-pushed
the
history-squash-default-upstream
branch
2 times, most recently
from
October 22, 2026 19:24
7b4b059 to
9f786f1
Compare
"git history squash" with no arguments refuses to run and asks for a revision range, even though the commits to squash are usually the ones on the current branch that its upstream does not have. The subcommand added in 6fd039c (history: add skeleton for squash subcommand, 2026-09-08) started out on the list as "git rebase --squash [<upstream>]", which folded "@{upstream}..HEAD" when given no argument. It moved to "git history" to take any range, and that default was lost in the move. Squash the commits since the branch forked off its upstream, so this keeps working after a fetch brings in new upstream commits. Signed-off-by: Harald Nordgren <haraldnordgren@gmail.com>
HaraldNordgren
force-pushed
the
history-squash-default-upstream
branch
from
October 22, 2026 21:33
9f786f1 to
793fff9
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Make
git history squashwith no range default to the commits on the current branch that are not in its upstream, likegit rebasedoes.