git-rebase-update.1 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. '\" t
  2. .\" Title: git-rebase-update
  3. .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author]
  4. .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
  5. .\" Date: 08/26/2022
  6. .\" Manual: Chromium depot_tools Manual
  7. .\" Source: depot_tools 59e95c91
  8. .\" Language: English
  9. .\"
  10. .TH "GIT\-REBASE\-UPDATE" "1" "08/26/2022" "depot_tools 59e95c91" "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-rebase-update \- Updates all branches to have the latest changes from their upstreams\&.
  32. .SH "SYNOPSIS"
  33. .sp
  34. .nf
  35. \fIgit rebase\-update\fR [\-v | \-\-verbose] [\-n | \-\-no\-fetch] [\-k | \-\-keep\-going]
  36. .fi
  37. .sp
  38. .SH "DESCRIPTION"
  39. .sp
  40. Brings all branches up\-to\-date with their tracking branches\&. This involves several phases:
  41. .PP
  42. Preparation
  43. .RS 4
  44. If you currently have a branch checked out, any changes on that branch are
  45. \fIfrozen\fR
  46. (See
  47. \fBgit-freeze\fR(1)
  48. for more detail)\&. Additionally, the current branch is recorded for the
  49. \fIRestoration\fR
  50. phase later (see
  51. \fICONFIGURATION VARIABLES\fR
  52. for details on
  53. \fBdepot\-tools\&.rebase\-update\&.starting\-branch\fR)\&.
  54. .RE
  55. .PP
  56. Fetching
  57. .RS 4
  58. All branches are examined to find their upstream references\&. The correct set of git remotes is determined, and fetched accordingly\&. Note that if any branches have a tag as their upstream, we are forced to pull all remotes\&.
  59. .sp
  60. Pass
  61. \fB\-\-no\-fetch\fR
  62. to skip this phase\&.
  63. .RE
  64. .PP
  65. Rebasing
  66. .RS 4
  67. All branches are rebased in topological order from roots (upstreams) to leaves\&. Each branch is rebased from its marked merge\-base (see
  68. \fICONFIGURATION VARIABLES\fR) to the branch tip on top of its parent branch\&. If the parent branch is
  69. \fIfrozen\fR
  70. (see
  71. \fBgit-freeze\fR(1)), the branch will be rebased onto the last non\-freeze commit on the parent branch\&.
  72. .sp
  73. Things get interesting when there are merge conflicts on rebase\&. The
  74. \fBmost common\fR
  75. cause for conflicts is when your branch has been committed to the upstream in squashed form, ala
  76. \fBgit-squash-branch\fR(1), which is what
  77. \fBgit-cl\fR(1)
  78. and the
  79. \fICommit Queue\fR
  80. will do\&. Because of that,
  81. \fBgit rebase\-update\fR
  82. will attempt to squash your conflicted branch to see if the squashed version applies cleanly to its upstream\&.
  83. .sp
  84. If it does not apply cleanly, then your original (non\-squashed) branch will be left in mid\-rebase and
  85. \fBgit rebase\-update\fR
  86. will exit\&. You can deal with this like any other conflicted rebase\&. When you\(cqre done, just
  87. \fBgit rebase\-update\fR
  88. again to pick up where you left off\&.
  89. .RE
  90. .sp
  91. If you\(cqd like to rebase all rebaseable branches in one pass and manually process the unrebaseable ones later, use \-k or \-\-keep\-going\&. Cleanup will not happen until all branches apply cleanly\&.
  92. .PP
  93. Cleanup
  94. .RS 4
  95. Once all the branches have been rebased, any empty branches (i\&.e\&. branches with no commits on them) are removed\&. If a branch is removed in this fashion, any branches which depend on it are reparented to the parent of the removed branch (see
  96. \fBgit-reparent-branch\fR(1))\&.
  97. .RE
  98. .PP
  99. Restoration
  100. .RS 4
  101. \fBgit rebase\-update\fR
  102. checks out the branch that you started on, and
  103. \fIthaws\fR
  104. it, if necessary (see
  105. \fBgit-thaw\fR(1))\&. If the branch you started on got cleaned up,
  106. \fBgit rebase\-update\fR
  107. will checkout the
  108. \fIroot\fR
  109. ref (defaults to
  110. \fIorigin\fR\*(Aqs default branch, as configured by
  111. \fBdepot\-tools\&.upstream\fR, see
  112. \fBgit-new-branch\fR(1))\&.
  113. .RE
  114. .SH "OPTIONS"
  115. .PP
  116. \-k, \-\-keep\-going
  117. .RS 4
  118. Keep processing past failed rebases\&.
  119. .RE
  120. .PP
  121. \-n, \-\-no\-fetch
  122. .RS 4
  123. Skip the
  124. \fBgit fetch\fR
  125. phase of rebase\-update\&.
  126. .RE
  127. .PP
  128. \-v, \-\-verbose
  129. .RS 4
  130. More text than your terminal can handle\&.
  131. .RE
  132. .PP
  133. \-\-current
  134. .RS 4
  135. Only rebase the current branch\&.
  136. .RE
  137. .SH "CONFIGURATION VARIABLES"
  138. .SS "depot\-tools\&.rebase\-update\&.starting\-branch"
  139. .sp
  140. When \fBgit rebase\-update\fR first runs, it will record the current branch here so that when it completes successfully, it will return back to the same branch you started on, even if \fBgit rebase\-update\fR is interrupted due to rebase conflicts\&. When \fBgit rebase\-update\fR completes successfully, this configuration variable is removed\&.
  141. .SS "branch\&.<name>\&.dormant"
  142. .sp
  143. If \fBtrue\fR, will cause rebase\-update to skip all processing on the branch\&. Useful for old/high\-conflict branches which you want to keep for posterity, but don\(cqt want to deal with when running \fBgit rebase\-update\fR
  144. .SS "branch\&.<name>\&.base"
  145. .sp
  146. Holds the \fIbase\fR reference for this branch\&. By default this is equivalent to \fBgit merge\-base <name> <name>@{upstream}\fR\&. However, it can diverge if \fB<name>@{upstream}\fR is manually rebased\&. In this case, it correctly preserves the value it had before, where \fBgit merge\-base\fR would now report the wrong value\&.
  147. .sp
  148. All of the tools in the \fBdepot_tools\fR(1) suite collude to keep this value as up\-to\-date as possible, including \fBgit-reparent-branch\fR(1), and \fBgit-new-branch\fR(1)\&. \fBgit-map\fR(1) also shows the location of these marker values in \fBwhite\fR\&.
  149. .sp
  150. \fBgit-mark-merge-base\fR(1) allows easy manual interaction for this value, in the unlikely event that it gets out of sync\&.
  151. .SH "SUGGESTED ALIASES"
  152. .sp
  153. Some common short\-hand aliases\&. Feel free to add these to your \fI~/\&.gitconfig\fR file\&.
  154. .sp
  155. .if n \{\
  156. .RS 4
  157. .\}
  158. .nf
  159. [alias]
  160. reup = rebase\-update
  161. .fi
  162. .if n \{\
  163. .RE
  164. .\}
  165. .sp
  166. .SH "SEE ALSO"
  167. .sp
  168. \fBgit-new-branch\fR(1), \fBgit-reparent-branch\fR(1), \fBgit-rename-branch\fR(1), \fBgit-upstream-diff\fR(1), \fBgit-freeze\fR(1), \fBgit-mark-merge-base\fR(1)
  169. .SH "CHROMIUM DEPOT_TOOLS"
  170. .sp
  171. 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\&.
  172. .SH "NOTES"
  173. .IP " 1." 4
  174. git repository
  175. .RS 4
  176. \%https://chromium.googlesource.com/chromium/tools/depot_tools.git
  177. .RE