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