File: git-squash-branch.1

package info (click to toggle)
chromium 139.0.7258.127-2
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 6,122,156 kB
  • sloc: cpp: 35,100,771; ansic: 7,163,530; javascript: 4,103,002; python: 1,436,920; asm: 946,517; xml: 746,709; pascal: 187,653; perl: 88,691; sh: 88,436; objc: 79,953; sql: 51,488; cs: 44,583; fortran: 24,137; makefile: 22,147; tcl: 15,277; php: 13,980; yacc: 8,984; ruby: 7,485; awk: 3,720; lisp: 3,096; lex: 1,327; ada: 727; jsp: 228; sed: 36
file content (131 lines) | stat: -rw-r--r-- 6,291 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
'\" t
.\"     Title: git-squash-branch
.\"    Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author]
.\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
.\"      Date: 05/07/2025
.\"    Manual: Chromium depot_tools Manual
.\"    Source: depot_tools fab0a429
.\"  Language: English
.\"
.TH "GIT\-SQUASH\-BRANCH" "1" "05/07/2025" "depot_tools fab0a429" "Chromium depot_tools Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el       .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
git-squash-branch \- Takes all commits in a single branch and replaces them with a single commit\&.
.SH "SYNOPSIS"
.sp
.nf
\fIgit squash\-branch\fR [\-m <message>]
.fi
.sp
.SH "DESCRIPTION"
.sp
\fBgit squash\-branch\fR is a simple helper command\&. It takes all the commits on the current branch from the \fImerge_base\fR to HEAD, and reduces them to a single commit\&. The new commit will contain a summary of all the commits which were squashed, preceded by a header message indicating that it\(cqs the result of a squash (or the message you pass on the command line\&.)\&.
.sp
Squashing branches is useful when trying to rebase\-update over branches which were pushed to their upstream (or committed by the \fICommit Queue\fR), and then conflicting changes landed in upstream on top of the push/commit\&. If you know that your branch was committed but \fBgit-rebase-update\fR(1) isn\(cqt able to automatically clean it, you can squash the troublesome branch before \fBgit rebase\-update\fR, and then when \fBgit rebase\-update\fR presents the conflict, you can verify that the conflict diff is what you expected (and then skip it with \fBgit rebase \-\-skip\fR)\&.
.SH "OPTIONS"
.PP
\-m <message>, \-\-message=<message>
.RS 4
Optional message to use for the first line of the squashed commit\&. If omitted, it defaults to "git squash commit for <branch>\&."\&.
.RE
.SH "EXAMPLE"
.sp

.sp
.if n \{\
.RS 4
.\}
.nf
\fB$ git map\fR
* \fBd0fb9c7283\fR	\fB(HEAD \-> frozen_branch\fR\fB) \fR2014\-04\-10 ~ FREEZE\&.unindexed
* \fBf48f415e0f\fR	2014\-04\-10 ~ modfile
* \fB4c5b9c0afd\fR	2014\-04\-10 ~ a deleted file
* \fBf7ce1e4b36\fR	\fB(fixit\fR\fB) \fR2014\-04\-10 ~ Add neat feature
* \fB3726937ae6\fR	2014\-04\-10 ~ Epic README update
| * \fB14db2e5a60\fR	\fB(cool_feature\fR\fB) \fR2014\-04\-10 ~ Respond to CL comments
| | * \fBee3f972810\fR	\fB(subfeature\fR\fB) \fR2014\-04\-10 ~ integrate with CoolService
| | * \fB4f9f5082c8\fR	2014\-04\-10 ~ slick commenting action
| |/
| * \fB7d84f8580a\fR	2014\-04\-10 ~ another improvement    <(\fBsubfeature\fR)
| * \fB27abea4b40\fR	\fB(spleen_tag\fR\fB) \fR2014\-04\-10 ~ Refactor spleen
| * \fBd8abe739e3\fR	2014\-04\-10 ~ Add widget
|/
* \fBbeec6f4746\fR	\fB(origin/main\fR\fB, origin/HEAD\fR\fB) \fR2014\-04\-10 ~ Make ReflectorImpl use mailboxes    <(\fBfixit, cool_feature\fR)
* \fB41290e02b7\fR	2014\-04\-10 ~ don\*(Aqt use glibc\-specific execinfo\&.h on uclibc builds
* \fBa76fde7b7b\fR	2014\-04\-10 ~ [fsp] Add requestUnmount() method together with the request manager\&.
* \fB9de7a713b3\fR	2014\-04\-10 ~ linux_aura: Use system configuration for middle clicking the titlebar\&.
* \fB073b0c203a\fR	2014\-04\-10 ~ ContentView\->ContentViewCore in ContentViewRenderView
* \fB2250f532d7\fR	2014\-04\-10 ~ ozone: evdev: Filter devices by path
* \fB33a7a742b7\fR	2014\-04\-10 ~ Always output seccomp error messages to stderr


\fB$ git squash\-branch \-m \*(Aqcool squash demo\*(Aq\fR
\fB$ git map\fR
* \fB98e69e80b9\fR	\fB(HEAD \-> frozen_branch\fR\fB) \fR2014\-04\-10 ~ cool squash demo
* \fBf7ce1e4b36\fR	\fB(fixit\fR\fB) \fR2014\-04\-10 ~ Add neat feature
* \fB3726937ae6\fR	2014\-04\-10 ~ Epic README update
| * \fB14db2e5a60\fR	\fB(cool_feature\fR\fB) \fR2014\-04\-10 ~ Respond to CL comments
| | * \fBee3f972810\fR	\fB(subfeature\fR\fB) \fR2014\-04\-10 ~ integrate with CoolService
| | * \fB4f9f5082c8\fR	2014\-04\-10 ~ slick commenting action
| |/
| * \fB7d84f8580a\fR	2014\-04\-10 ~ another improvement    <(\fBsubfeature\fR)
| * \fB27abea4b40\fR	\fB(spleen_tag\fR\fB) \fR2014\-04\-10 ~ Refactor spleen
| * \fBd8abe739e3\fR	2014\-04\-10 ~ Add widget
|/
* \fBbeec6f4746\fR	\fB(origin/main\fR\fB, origin/HEAD\fR\fB) \fR2014\-04\-10 ~ Make ReflectorImpl use mailboxes    <(\fBcool_feature, fixit\fR)
* \fB41290e02b7\fR	2014\-04\-10 ~ don\*(Aqt use glibc\-specific execinfo\&.h on uclibc builds
* \fBa76fde7b7b\fR	2014\-04\-10 ~ [fsp] Add requestUnmount() method together with the request manager\&.
* \fB9de7a713b3\fR	2014\-04\-10 ~ linux_aura: Use system configuration for middle clicking the titlebar\&.
* \fB073b0c203a\fR	2014\-04\-10 ~ ContentView\->ContentViewCore in ContentViewRenderView
* \fB2250f532d7\fR	2014\-04\-10 ~ ozone: evdev: Filter devices by path
* \fB33a7a742b7\fR	2014\-04\-10 ~ Always output seccomp error messages to stderr
.fi
.if n \{\
.RE
.\}
.sp
.SH "SUGGESTED ALIASES"
.sp
Some common short\-hand aliases\&. Feel free to add these to your \fI~/\&.gitconfig\fR file\&.
.sp
.if n \{\
.RS 4
.\}
.nf
[alias]
  squash = squash\-branch
.fi
.if n \{\
.RE
.\}
.sp
.SH "SEE ALSO"
.sp
\fBgit-rebase-update\fR(1)
.SH "CHROMIUM DEPOT_TOOLS"
.sp
Part of the chromium \fBdepot_tools\fR(7) suite\&. These tools are meant to assist with the development of chromium and related projects\&. Download the tools by checking out the \m[blue]\fBgit repository\fR\m[]\&\s-2\u[1]\d\s+2\&.
.SH "NOTES"
.IP " 1." 4
git repository
.RS 4
\%https://chromium.googlesource.com/chromium/tools/depot_tools.git
.RE