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