blob: e9694be88e4a420f6d6a08afb68f4c546ace4432 [file] [log] [blame]
iannucci@chromium.orgc050a5b2014-03-26 06:18:50 +00001git-squash-branch(1)
2====================
3
4NAME
5----
6git-squash-branch -
7include::_git-squash-branch_desc.helper.txt[]
8
9SYNOPSIS
10--------
11[verse]
12'git squash-branch' [-m <message>]
13
14DESCRIPTION
15-----------
16
17`git squash-branch` is a simple helper command. It takes all the commits on the
18current branch from the 'merge_base' to HEAD, and reduces them to a single
19commit. The new commit will contain a summary of all the commits which were
Quinten Yearsley442fb642016-12-15 15:38:27 -080020squashed, preceded by a header message indicating that it's the result of a
iannucci@chromium.orgc050a5b2014-03-26 06:18:50 +000021squash (or the message you pass on the command line.).
22
23Squashing branches is useful when trying to rebase-update over branches which
24were pushed to their upsteram (or committed by the 'Commit Queue'), and then
25conflicting changes landed in upstream on top of the push/commit. If you know
26that your branch was committed but linkgit:git-rebase-update[1] isn't able to
27automatically clean it, you can squash the troublesome branch before `git
28rebase-update`, and then when `git rebase-update` presents the conflict, you can
29verify that the conflict diff is what you expected (and then skip it with
30`git rebase --skip`).
31
32OPTIONS
33-------
34
35-m <message>::
36--message=<message>::
37 Optional message to use for the first line of the squashed commit. If omitted,
Alan Cutter00017822016-12-20 17:39:59 +110038 it defaults to "git squash commit for <branch>.".
iannucci@chromium.orgc050a5b2014-03-26 06:18:50 +000039
40EXAMPLE
41-------
iannucci@chromium.org21980022014-04-11 04:51:49 +000042demo:1[]
iannucci@chromium.orgc050a5b2014-03-26 06:18:50 +000043
iannucci@chromium.orgc050a5b2014-03-26 06:18:50 +000044
45include::_aliases.txt[]
46
47----
48[alias]
49 git squash = squash-branch
50----
51
52
53SEE ALSO
54--------
55linkgit:git-rebase-update[1]
56
57include::_footer.txt[]
58
59// vim: ft=asciidoc: