1GIT-REVISE(1) git-revise GIT-REVISE(1)
2
3
4
6 git-revise - Efficiently update, split, and rearrange git commits
7
9 git revise [<options>] [<target>]
10
12 git revise is a git(1) subcommand to efficiently update, split, and re‐
13 arrange commits. It is heavily inspired by git-rebase(1), however tries
14 to be more efficient and ergonomic for patch-stack oriented workflows.
15
16 By default, git revise will apply staged changes to <target>, updating
17 HEAD to point at the revised history. It also supports splitting com‐
18 mits, rewording commit messages.
19
20 Unlike git-rebase(1), git revise avoids modifying working directory and
21 index state, performing all merges in-memory, and only writing them
22 when necessary. This allows it to be significantly faster on large
23 codebases, and avoid invalidating builds.
24
25 If --autosquash or --interactive is specified, the <target> argument
26 may be omitted or given as the special value :option:--root. If it is
27 omitted, git revise will consider a range of unpublished commits on the
28 current branch. If given as :option:--root, all commits including the
29 root commit will be considered.
30
32 General options
33 -a, --all
34 Stage changes to tracked files before revising.
35
36 -p, --patch
37 Interactively stage hunks from the worktree before revising.
38
39 --no-index
40 Ignore staged changes in the index.
41
42 --reauthor
43 Reset target commit's author to the current user.
44
45 --ref <gitref>
46 Working branch to update; defaults to HEAD.
47
48 -S, --gpg-sign, --no-gpg-sign
49 GPG-sign commits. Overrides both the commit.gpgSign and re‐
50 vise.gpgSign git configurations.
51
52 Main modes of operation
53 -i, --interactive
54 Rather than applying staged changes to <target>, edit a todo
55 list of actions to perform on commits after <target>. See
56 INTERACTIVE MODE.
57
58 --autosquash, --no-autosquash
59 Rather than directly applying staged changes to <target>, auto‐
60 matically perform fixup or squash actions marked with fixup! or
61 squash! between <target> and the current HEAD. For more infor‐
62 mation on what these actions do, see INTERACTIVE MODE.
63
64 These commits are usually created with git commit --fixup=<com‐
65 mit> or git commit --squash=<commit>, and identify the target
66 with the first line of its commit message.
67
68 This option can be combined with --interactive to modify the
69 generated todos before they're executed.
70
71 If the --autosquash option is enabled by default using a config‐
72 uration variable, the option --no-autosquash can be used to
73 override and disable this setting. See CONFIGURATION.
74
75 -c, --cut
76 Interactively select hunks from <target>. The chosen hunks are
77 split into a second commit immediately after the target.
78
79 After splitting is complete, both commits' messages are edited.
80
81 See the "Interactive Mode" section of git-add(1) to learn how to
82 operate this mode.
83
84 -e, --edit
85 After applying staged changes, edit <target>'s commit message.
86
87 This option can be combined with --interactive to allow editing
88 of commit messages within the todo list. For more information
89 on, see INTERACTIVE MODE.
90
91 -m <msg>, --message <msg>
92 Use the given <msg> as the new commit message for <target>. If
93 multiple -m options are given, their values are concatenated as
94 separate paragraphs.
95
96 --version
97 Print version information and exit.
98
100 Configuration is managed by git-config(1).
101
102 revise.autoSquash
103 If set to true, imply --autosquash whenever --interactive is
104 specified. Overridden by --no-autosquash. Defaults to false. If
105 not set, the value of rebase.autoSquash is used instead.
106
107 revise.gpgSign
108 If set to true, GPG-sign new commits; defaults to false. This
109 setting overrides the original git configuration commit.gpgSign
110 and may be overridden by the command line options --gpg-sign and
111 --no-gpg-sign.
112
114 When a conflict is encountered, git revise will attempt to resolve it
115 automatically using standard git mechanisms. If automatic resolution
116 fails, the user will be prompted to resolve them manually.
117
118 There is currently no support for using git-mergetool(1) to resolve
119 conflicts.
120
121 No attempt is made to detect renames of files or directories. git re‐
122 vise may produce suboptimal results across renames. Use the interactive
123 mode of git-rebase(1) when rename tracking is important.
124
126 A successful git revise will add a single entry to the reflog, allowing
127 it to be undone with git reset @{1}. Unsuccessful git revise commands
128 will leave your repository largely unmodified.
129
130 No merge commits may occur between the target commit and HEAD, as
131 rewriting them is not supported.
132
133 See git-rebase(1) for more information on the implications of modifying
134 history on a repository that you share.
135
137 git revise supports an interactive mode inspired by the interactive
138 mode of git-rebase(1).
139
140 This mode is started with the last commit you want to retain "as-is":
141
142 git revise -i <after-this-commit>
143
144 The special target --root is available to revise everything up to the
145 root commit:
146
147 git revise -i --root
148
149 An editor will be fired up with the commits in your current branch af‐
150 ter the given commit. If the index has any staged but uncommitted
151 changes, a <git index> entry will also be present.
152
153 pick 8338dfa88912 Oneline summary of first commit
154 pick 735609912343 Summary of second commit
155 index 672841329981 <git index>
156
157 These commits may be re-ordered to change the order they appear in his‐
158 tory. In addition, the pick and index commands may be replaced to mod‐
159 ify their behaviour. If present, index commands must be at the bottom
160 of the list, i.e. they can not be followed by non-index commands.
161
162 If -e was specified, the full commit message will be included, and each
163 command line will begin with a ++. Any changes made to the commit mes‐
164 sages in this file will be applied to the commit in question, allowing
165 for simultaneous editing of commit messages during the todo editing
166 phase.
167
168 ++ pick 8338dfa88912
169 Oneline summary of first commit
170
171 Body of first commit
172
173 ++ pick 735609912343
174 Summary of second commit
175
176 Body of second commit
177
178 ++ index 672841329981
179 <git index>
180
181 The following commands are supported in all interactive modes:
182
183 index Do not commit these changes, instead leaving them staged in the
184 index. Index lines must come last in the file.
185
186 pick Use the given commit as-is in history. When applied to the gen‐
187 erated index entry, the commit will have the message <git in‐
188 dex>.
189
190 squash Add the commit's changes into the previous commit and open an
191 editor to merge the commits' messages.
192
193 fixup Like squash, but discard this commit's message rather than edit‐
194 ing.
195
196 reword Open an editor to modify the commit message.
197
198 cut Interactively select hunks from the commit. The chosen hunks are
199 split into a second commit immediately after it.
200
201 After splitting is complete, both commits' messages are edited.
202
203 See the "Interactive Mode" section of git-add(1) to learn how to
204 operate this mode.
205
207 Please report issues and feature requests to the issue tracker at
208 https://github.com/mystor/git-revise/issues.
209
210 Code, documentation and other contributions are also welcomed.
211
213 git(1) git-rebase(1) git-add(1)
214
216 2018-2022, Nika Layzell
217
218
219
220
2210.7.0 Jan 05, 2022 GIT-REVISE(1)