1GIT-SQUASH(1)                     Git Extras                     GIT-SQUASH(1)
2
3
4

NAME

6       git-squash - squash N last changes up to a ref´ed commit
7

SYNOPSIS

9       git-squash  [<--squash-msg>]  <source-branch|commit  ref> [<commit-mes‐
10       sage>]
11

DESCRIPTION

13       Squash the N last changes in the current branch, where N is  the  range
14       of commits from the given ref up to HEAD.
15

OPTIONS

17       <source-branch>
18
19       Branch to squash on the current branch.
20
21       <commit  reference>  A  commit  reference  (has  to be from the current
22       branch) can also be used as the first  argument.  A  range  of  commits
23       sha..HEAD will be squashed.
24
25       <--squash-msg>
26
27       Commit  the squash result with the concatenated squashed committed mes‐
28       sages. This option can not be used together with <commit-message>.
29
30       <commit-message>
31
32       If commit-message is given, commit the squashed result,  otherwise  the
33       squash remains just added to the index and is not committed.
34

EXAMPLES

36       # squash changes and follow up with separate commit step
37       $ git squash my-other-branch
38       Updating a2740f5..533b19c
39       Fast-forward
40       Squash commit -- not updating HEAD
41        my-changed-file | 1 +
42        1 file changed, 1 insertion(+)
43       $ git commit -m "New commit without a real merge"
44
45       # squash and commit with given message
46       $ git squash HEAD~3 "Commit message"
47
48       # squash and commit and concatenate all messages
49       $ git squash --squash-msg @~3
50

AUTHOR

52       Written by Jesús Espino <jespinog@gmail.com>
53

REPORTING BUGS

55       <https://github.com/tj/git-extras/issues>
56

SEE ALSO

58       <https://github.com/tj/git-extras>
59
60
61
62                                 October 2020                    GIT-SQUASH(1)
Impressum