.\" generated with Ronn-NG/v0.9.1 .\" http://github.com/apjanke/ronn-ng/tree/0.9.1 .TH "GIT\-SQUASH" "1" "November 2023" "" "Git Extras" .SH "NAME" \fBgit\-squash\fR \- squash N last changes up to a ref'ed commit .SH "SYNOPSIS" .TS allbox; \fBgit\-squash\fR [<\-\-squash\-msg>] [] .TE .SH "DESCRIPTION" Squash the N last changes in the current branch, where N is the range of commits from the given ref up to HEAD\. .SH "OPTIONS" .P Branch to squash on the current branch\. .P \fIsha\fR\.\.HEAD will be squashed\. .P <\-\-squash\-msg> .P Commit the squash result with the concatenated squashed committed messages\. This option can not be used together with \. .P .P If commit\-message is given, commit the squashed result, otherwise the squash remains just added to the index and is not committed\. .SH "EXAMPLES" .nf # squash changes and follow up with separate commit step $ git squash my\-other\-branch Updating a2740f5\.\.533b19c Fast\-forward Squash commit \-\- not updating HEAD my\-changed\-file | 1 + 1 file changed, 1 insertion(+) $ git commit \-m "New commit without a real merge" # squash and commit with given message $ git squash HEAD~3 "Commit message" # squash and commit and concatenate all messages $ git squash \-\-squash\-msg @~3 .fi .SH "AUTHOR" Written by Jesús Espino <\fIjespinog@gmail\.com\fR> .SH "REPORTING BUGS" <\fIhttps://github\.com/tj/git\-extras/issues\fR> .SH "SEE ALSO" <\fIhttps://github\.com/tj/git\-extras\fR>