git-squash-branch.1 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. '\" t
  2. .\" Title: git-squash-branch
  3. .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
  4. .\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
  5. .\" Date: 05/03/2019
  6. .\" Manual: Chromium depot_tools Manual
  7. .\" Source: depot_tools e58cce6c
  8. .\" Language: English
  9. .\"
  10. .TH "GIT\-SQUASH\-BRANCH" "1" "05/03/2019" "depot_tools e58cce6c" "Chromium depot_tools Manual"
  11. .\" -----------------------------------------------------------------
  12. .\" * Define some portability stuff
  13. .\" -----------------------------------------------------------------
  14. .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  15. .\" http://bugs.debian.org/507673
  16. .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
  17. .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  18. .ie \n(.g .ds Aq \(aq
  19. .el .ds Aq '
  20. .\" -----------------------------------------------------------------
  21. .\" * set default formatting
  22. .\" -----------------------------------------------------------------
  23. .\" disable hyphenation
  24. .nh
  25. .\" disable justification (adjust text to left margin only)
  26. .ad l
  27. .\" -----------------------------------------------------------------
  28. .\" * MAIN CONTENT STARTS HERE *
  29. .\" -----------------------------------------------------------------
  30. .SH "NAME"
  31. git-squash-branch \- Takes all commits in a single branch and replaces them with a single commit\&.
  32. .SH "SYNOPSIS"
  33. .sp
  34. .nf
  35. \fIgit squash\-branch\fR [\-m <message>]
  36. .fi
  37. .sp
  38. .SH "DESCRIPTION"
  39. .sp
  40. 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, preceded by a header message indicating that it\(cqs the result of a squash (or the message you pass on the command line\&.)\&.
  41. .sp
  42. 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)\&.
  43. .SH "OPTIONS"
  44. .PP
  45. \-m <message>, \-\-message=<message>
  46. .RS 4
  47. Optional message to use for the first line of the squashed commit\&. If omitted, it defaults to "git squash commit for <branch>\&."\&.
  48. .RE
  49. .SH "EXAMPLE"
  50. .sp
  51. .sp
  52. .if n \{\
  53. .RS 4
  54. .\}
  55. .nf
  56. \fB$ git map\fR
  57. * \fBd0fb9c7 \fR (HEAD \-> frozen_branch) 2014\-04\-10 ~ FREEZE\&.unindexed
  58. * \fBf48f415 \fR 2014\-04\-10 ~ modfile
  59. * \fB4c5b9c0 \fR 2014\-04\-10 ~ a deleted file
  60. * \fBf7ce1e4 \fR (\fBfixit\fR) 2014\-04\-10 ~ Add neat feature\fB <(frozen_branch)\fR
  61. * \fB3726937 \fR 2014\-04\-10 ~ Epic README update
  62. | * \fB14db2e5 \fR (\fBcool_feature\fR) 2014\-04\-10 ~ Respond to CL comments
  63. | | * \fBee3f972 \fR (\fBsubfeature\fR) 2014\-04\-10 ~ integrate with CoolService
  64. | | * \fB4f9f508 \fR 2014\-04\-10 ~ slick commenting action
  65. | |/
  66. | * \fB7d84f85 \fR 2014\-04\-10 ~ another improvement\fB <(subfeature)\fR
  67. | * \fB27abea4 \fR (\fBspleen_tag\fR) 2014\-04\-10 ~ Refactor spleen
  68. | * \fBd8abe73 \fR 2014\-04\-10 ~ Add widget
  69. |/
  70. * \fBbeec6f4 \fR (origin/master, origin/HEAD) 2014\-04\-10 ~ Make ReflectorImpl use mailboxes\fB <(cool_feature, fixit)\fR
  71. * \fB41290e0 \fR 2014\-04\-10 ~ don\*(Aqt use glibc\-specific execinfo\&.h on uclibc builds
  72. * \fBa76fde7 \fR 2014\-04\-10 ~ [fsp] Add requestUnmount() method together with the request manager\&.
  73. * \fB9de7a71 \fR 2014\-04\-10 ~ linux_aura: Use system configuration for middle clicking the titlebar\&.
  74. * \fB073b0c2 \fR 2014\-04\-10 ~ ContentView\->ContentViewCore in ContentViewRenderView
  75. * \fB2250f53 \fR 2014\-04\-10 ~ ozone: evdev: Filter devices by path
  76. * \fB33a7a74 \fR 2014\-04\-10 ~ Always output seccomp error messages to stderr
  77. \fB$ git squash\-branch \-m \*(Aqcool squash demo\*(Aq\fR
  78. \fB$ git map\fR
  79. * \fB98e69e8 \fR (HEAD \-> frozen_branch) 2014\-04\-10 ~ cool squash demo
  80. * \fBf7ce1e4 \fR (\fBfixit\fR) 2014\-04\-10 ~ Add neat feature\fB <(frozen_branch)\fR
  81. * \fB3726937 \fR 2014\-04\-10 ~ Epic README update
  82. | * \fB14db2e5 \fR (\fBcool_feature\fR) 2014\-04\-10 ~ Respond to CL comments
  83. | | * \fBee3f972 \fR (\fBsubfeature\fR) 2014\-04\-10 ~ integrate with CoolService
  84. | | * \fB4f9f508 \fR 2014\-04\-10 ~ slick commenting action
  85. | |/
  86. | * \fB7d84f85 \fR 2014\-04\-10 ~ another improvement\fB <(subfeature)\fR
  87. | * \fB27abea4 \fR (\fBspleen_tag\fR) 2014\-04\-10 ~ Refactor spleen
  88. | * \fBd8abe73 \fR 2014\-04\-10 ~ Add widget
  89. |/
  90. * \fBbeec6f4 \fR (origin/master, origin/HEAD) 2014\-04\-10 ~ Make ReflectorImpl use mailboxes\fB <(cool_feature, fixit)\fR
  91. * \fB41290e0 \fR 2014\-04\-10 ~ don\*(Aqt use glibc\-specific execinfo\&.h on uclibc builds
  92. * \fBa76fde7 \fR 2014\-04\-10 ~ [fsp] Add requestUnmount() method together with the request manager\&.
  93. * \fB9de7a71 \fR 2014\-04\-10 ~ linux_aura: Use system configuration for middle clicking the titlebar\&.
  94. * \fB073b0c2 \fR 2014\-04\-10 ~ ContentView\->ContentViewCore in ContentViewRenderView
  95. * \fB2250f53 \fR 2014\-04\-10 ~ ozone: evdev: Filter devices by path
  96. * \fB33a7a74 \fR 2014\-04\-10 ~ Always output seccomp error messages to stderr
  97. .fi
  98. .if n \{\
  99. .RE
  100. .\}
  101. .sp
  102. .SH "SUGGESTED ALIASES"
  103. .sp
  104. Some common short\-hand aliases\&. Feel free to add these to your \fI~/\&.gitconfig\fR file\&.
  105. .sp
  106. .if n \{\
  107. .RS 4
  108. .\}
  109. .nf
  110. [alias]
  111. git squash = squash\-branch
  112. .fi
  113. .if n \{\
  114. .RE
  115. .\}
  116. .sp
  117. .SH "SEE ALSO"
  118. .sp
  119. \fBgit-rebase-update\fR(1)
  120. .SH "CHROMIUM DEPOT_TOOLS"
  121. .sp
  122. 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 from \m[blue]\fBhere\fR\m[]\&\s-2\u[1]\d\s+2\&.
  123. .SH "NOTES"
  124. .IP " 1." 4
  125. here
  126. .RS 4
  127. \%https://chromium.googlesource.com/chromium/tools/depot_tools.git
  128. .RE