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 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320
|
.\" Man page generated from reStructuredText.
.
.TH "GIT-REVISE" "1" "Jan 05, 2022" "0.7.0" "git-revise"
.SH NAME
git-revise \- Efficiently update, split, and rearrange git commits
.
.nr rst2man-indent-level 0
.
.de1 rstReportMargin
\\$1 \\n[an-margin]
level \\n[rst2man-indent-level]
level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
-
\\n[rst2man-indent0]
\\n[rst2man-indent1]
\\n[rst2man-indent2]
..
.de1 INDENT
.\" .rstReportMargin pre:
. RS \\$1
. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
. nr rst2man-indent-level +1
.\" .rstReportMargin post:
..
.de UNINDENT
. RE
.\" indent \\n[an-margin]
.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
.nr rst2man-indent-level -1
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.SH SYNOPSIS
.sp
\fIgit revise\fP [<options>] [<target>]
.SH DESCRIPTION
.sp
\fBgit revise\fP is a \fBgit(1)\fP subcommand to efficiently
update, split, and rearrange commits. It is heavily inspired by
\fBgit\-rebase(1)\fP, however tries to be more efficient and ergonomic for
patch\-stack oriented workflows.
.sp
By default, \fBgit revise\fP will apply staged changes to <target>,
updating \fBHEAD\fP to point at the revised history. It also supports splitting
commits, rewording commit messages.
.sp
Unlike \fBgit\-rebase(1)\fP, \fBgit revise\fP avoids modifying
working directory and index state, performing all merges in\-memory, and only
writing them when necessary. This allows it to be significantly faster on
large codebases, and avoid invalidating builds.
.sp
If \fI\%\-\-autosquash\fP or \fI\%\-\-interactive\fP is specified, the
<target> argument may be omitted or given as the special value \fI:option:\-\-root\fP\&.
If it is omitted, \fBgit revise\fP will consider a range of unpublished
commits on the current branch. If given as \fI:option:\-\-root\fP, all commits
including the root commit will be considered.
.SH OPTIONS
.SS General options
.INDENT 0.0
.TP
.B \-a, \-\-all
Stage changes to tracked files before revising.
.UNINDENT
.INDENT 0.0
.TP
.B \-p, \-\-patch
Interactively stage hunks from the worktree before revising.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-no\-index
Ignore staged changes in the index.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-reauthor
Reset target commit\(aqs author to the current user.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-ref <gitref>
Working branch to update; defaults to \fBHEAD\fP\&.
.UNINDENT
.INDENT 0.0
.TP
.B \-S, \-\-gpg\-sign, \-\-no\-gpg\-sign
GPG\-sign commits. Overrides both the \fBcommit.gpgSign\fP and
\fBrevise.gpgSign\fP git configurations.
.UNINDENT
.SS Main modes of operation
.INDENT 0.0
.TP
.B \-i, \-\-interactive
Rather than applying staged changes to <target>, edit a todo list of
actions to perform on commits after <target>. See \fI\%INTERACTIVE MODE\fP\&.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-autosquash, \-\-no\-autosquash
Rather than directly applying staged changes to <target>, automatically
perform fixup or squash actions marked with \fBfixup!\fP or \fBsquash!\fP
between <target> and the current \fBHEAD\fP\&. For more information on what
these actions do, see \fI\%INTERACTIVE MODE\fP\&.
.sp
These commits are usually created with \fBgit commit \-\-fixup=<commit>\fP or
\fBgit commit \-\-squash=<commit>\fP, and identify the target with the first
line of its commit message.
.sp
This option can be combined with \fI\%\-\-interactive\fP to modify the
generated todos before they\(aqre executed.
.sp
If the \fI\%\-\-autosquash\fP option is enabled by default using a
configuration variable, the option \fI\%\-\-no\-autosquash\fP can be used
to override and disable this setting. See \fI\%CONFIGURATION\fP\&.
.UNINDENT
.INDENT 0.0
.TP
.B \-c, \-\-cut
Interactively select hunks from <target>. The chosen hunks are split into
a second commit immediately after the target.
.sp
After splitting is complete, both commits\(aq messages are edited.
.sp
See the "Interactive Mode" section of \fBgit\-add(1)\fP to learn how
to operate this mode.
.UNINDENT
.INDENT 0.0
.TP
.B \-e, \-\-edit
After applying staged changes, edit <target>\(aqs commit message.
.sp
This option can be combined with \fI\%\-\-interactive\fP to allow editing
of commit messages within the todo list. For more information on, see
\fI\%INTERACTIVE MODE\fP\&.
.UNINDENT
.INDENT 0.0
.TP
.B \-m <msg>, \-\-message <msg>
Use the given <msg> as the new commit message for <target>. If multiple
\fI\%\-m\fP options are given, their values are concatenated as separate
paragraphs.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-version
Print version information and exit.
.UNINDENT
.SH CONFIGURATION
.sp
Configuration is managed by \fBgit\-config(1)\fP\&.
.INDENT 0.0
.TP
.B revise.autoSquash
If set to true, imply \fI\%\-\-autosquash\fP whenever \fI\%\-\-interactive\fP
is specified. Overridden by \fI\%\-\-no\-autosquash\fP\&. Defaults to false. If
not set, the value of \fBrebase.autoSquash\fP is used instead.
.UNINDENT
.INDENT 0.0
.TP
.B revise.gpgSign
If set to true, GPG\-sign new commits; defaults to false. This setting
overrides the original git configuration \fBcommit.gpgSign\fP and may be
overridden by the command line options \fB\-\-gpg\-sign\fP and
\fB\-\-no\-gpg\-sign\fP\&.
.UNINDENT
.SH CONFLICT RESOLUTION
.sp
When a conflict is encountered, \fBgit revise\fP will attempt to resolve
it automatically using standard git mechanisms. If automatic resolution
fails, the user will be prompted to resolve them manually.
.sp
There is currently no support for using \fBgit\-mergetool(1)\fP to
resolve conflicts.
.sp
No attempt is made to detect renames of files or directories. \fBgit
revise\fP may produce suboptimal results across renames. Use the interactive
mode of \fBgit\-rebase(1)\fP when rename tracking is important.
.SH NOTES
.sp
A successful \fBgit revise\fP will add a single entry to the reflog,
allowing it to be undone with \fBgit reset @{1}\fP\&. Unsuccessful \fBgit
revise\fP commands will leave your repository largely unmodified.
.sp
No merge commits may occur between the target commit and \fBHEAD\fP, as
rewriting them is not supported.
.sp
See \fBgit\-rebase(1)\fP for more information on the implications of
modifying history on a repository that you share.
.SH INTERACTIVE MODE
.sp
\fBgit revise\fP supports an interactive mode inspired by the
interactive mode of \fBgit\-rebase(1)\fP\&.
.sp
This mode is started with the last commit you want to retain "as\-is":
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
git revise \-i <after\-this\-commit>
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
The special target \fI\-\-root\fP is available to revise everything up to the root
commit:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
git revise \-i \-\-root
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
An editor will be fired up with the commits in your current branch after the
given commit. If the index has any staged but uncommitted changes, a \fB<git
index>\fP entry will also be present.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
pick 8338dfa88912 Oneline summary of first commit
pick 735609912343 Summary of second commit
index 672841329981 <git index>
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
These commits may be re\-ordered to change the order they appear in history.
In addition, the \fBpick\fP and \fBindex\fP commands may be replaced to modify
their behaviour. If present, \fBindex\fP commands must be at the bottom of the
list, i.e. they can not be followed by non\-index commands.
.sp
If \fI\%\-e\fP was specified, the full commit message will be included, and
each command line will begin with a \fB++\fP\&. Any changes made to the commit
messages in this file will be applied to the commit in question, allowing for
simultaneous editing of commit messages during the todo editing phase.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
++ pick 8338dfa88912
Oneline summary of first commit
Body of first commit
++ pick 735609912343
Summary of second commit
Body of second commit
++ index 672841329981
<git index>
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
The following commands are supported in all interactive modes:
.INDENT 0.0
.TP
.B index
Do not commit these changes, instead leaving them staged in the index.
Index lines must come last in the file.
.UNINDENT
.INDENT 0.0
.TP
.B pick
Use the given commit as\-is in history. When applied to the generated
\fBindex\fP entry, the commit will have the message \fB<git index>\fP\&.
.UNINDENT
.INDENT 0.0
.TP
.B squash
Add the commit\(aqs changes into the previous commit and open an editor
to merge the commits\(aq messages.
.UNINDENT
.INDENT 0.0
.TP
.B fixup
Like squash, but discard this commit\(aqs message rather than editing.
.UNINDENT
.INDENT 0.0
.TP
.B reword
Open an editor to modify the commit message.
.UNINDENT
.INDENT 0.0
.TP
.B cut
Interactively select hunks from the commit. The chosen hunks are split
into a second commit immediately after it.
.sp
After splitting is complete, both commits\(aq messages are edited.
.sp
See the "Interactive Mode" section of \fBgit\-add(1)\fP to learn how
to operate this mode.
.UNINDENT
.SH REPORTING BUGS
.sp
Please report issues and feature requests to the issue tracker at
\fI\%https://github.com/mystor/git\-revise/issues\fP\&.
.sp
Code, documentation and other contributions are also welcomed.
.SH SEE ALSO
.sp
\fBgit(1)\fP
\fBgit\-rebase(1)\fP
\fBgit\-add(1)\fP
.SH COPYRIGHT
2018-2022, Nika Layzell
.\" Generated by docutils manpage writer.
.
|