'\" t .\" Title: git-squash-branch .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: 03/25/2014 .\" Manual: Chromium depot_tools Manual .\" Source: depot_tools 207bff1 .\" Language: English .\" .TH "GIT\-SQUASH\-BRANCH" "1" "03/25/2014" "depot_tools 207bff1" "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 ] .fi .sp .SH "DESCRIPTION" .sp git squash\-branch 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, preceeded 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 upsteram (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 git rebase\-update, and then when git rebase\-update presents the conflict, you can verify that the conflict diff is what you expected (and then skip it with git rebase \-\-skip)\&. .SH "OPTIONS" .PP \-m , \-\-message= .RS 4 Optional message to use for the first line of the squashed commit\&. If omitted, it defaults to "git squash commit\&."\&. .RE .SH "EXAMPLE" .sp .if n \{\ .RS 4 .\} .nf \fB$ git map\fR *\:\fB 7dcfe47 \fR (\:\fBfrozen_changes\fR\:) 2014\-03\-12 ~ FREEZE\&.unindexed * \fB4b0c180\fR 2014\-03\-12 ~ modfile * \fB59a7cca\fR 2014\-03\-12 ~ a deleted file * \fB6bec695\fR (\:origin/master\:) 2014\-03\-11 ~ Add neat feature \fB<(frozen_changes)\fR * \fBd15a38a\fR 2014\-03\-11 ~ Epic README update * \fBd559894\fR (\:\fBmaster\fR\:) 2014\-03\-11 ~ Important upstream change | * \fB9c311fd\fR (\:\fBcool_feature\fR\:) 2014\-03\-11 ~ Respond to CL comments | | * \fB2a1eeb2\fR (\:\fBsubfeature\fR\:) 2014\-03\-11 ~ integrate with CoolService | | * \fBd777af6\fR 2014\-03\-11 ~ slick commenting action | |/ | * \fB265803a\fR 2014\-03\-11 ~ another improvement \fB<(subfeature)\fR | * \fB6d831ac\fR (\:\fBspleen_tag\fR\:) 2014\-03\-11 ~ Refactor spleen | * \fB82e74ab\fR 2014\-03\-11 ~ Add widget |/ * \fBd08c5b3\fR (\:\fBbogus_noparent\fR\:) 2014\-03\-11 ~ Wonderful beginnings \fB<(cool_feature)\fR \fB$ git squash\-branch "cool squash demo"\fR \fB$ git map\fR *\:\fB 2c81508 \fR (\:\fBfrozen_changes\fR\:) 2014\-03\-22 ~ cool squash demo * \fB6bec695\fR (\:origin/master\:) 2014\-03\-11 ~ Add neat feature \fB<(frozen_changes)\fR * \fBd15a38a\fR 2014\-03\-11 ~ Epic README update * \fBd559894\fR (\:\fBmaster\fR\:) 2014\-03\-11 ~ Important upstream change | * \fB9c311fd\fR (\:\fBcool_feature\fR\:) 2014\-03\-11 ~ Respond to CL comments | | * \fB2a1eeb2\fR (\:\fBsubfeature\fR\:) 2014\-03\-11 ~ integrate with CoolService | | * \fBd777af6\fR 2014\-03\-11 ~ slick commenting action | |/ | * \fB265803a\fR 2014\-03\-11 ~ another improvement \fB<(subfeature)\fR | * \fB6d831ac\fR (\:\fBspleen_tag\fR\:) 2014\-03\-11 ~ Refactor spleen | * \fB82e74ab\fR 2014\-03\-11 ~ Add widget |/ * \fBd08c5b3\fR (\:\fBbogus_noparent\fR\:) 2014\-03\-11 ~ Wonderful beginnings \fB<(cool_feature)\fR .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] git 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(1) suite\&. These tools are meant to assist with the development of chromium and related projects\&. Download the tools from \m[blue]\fBhere\fR\m[]\&\s-2\u[1]\d\s+2\&. .SH "NOTES" .IP " 1." 4 here .RS 4 \%https://chromium.googlesource.com/chromium/tools/depot_tools.git .RE