doc: git rebase: dedup merge conflict discussion

Previously there were two explanations, this combines them both into a single explanation. Signed-off-by: Julia Evans <julia@jvns.ca> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Julia Evans committed Aug 23, 2025 at 00:42 UTC af5a099197fca46fd0a255fe036ab03f2d63ffe3
1 file changed +20 -29
Documentation/git-rebase.adoc
+20 -29
@@ -42,6 +42,26 @@ shortcut for `git checkout topic && git rebase master`.
42 ------------
43
44
45 +If there is a merge conflict during this process, `git rebase` will stop at the
46 +first problematic commit and leave conflict markers. If this happens, you can do
47 +one of these things:
48 +
49 +1. Resolve the conflict. You can use `git diff` to find the markers (<<<<<<)
50 + and make edits to resolve the conflict. For each file you edit, you need to
51 + tell Git that the conflict has been resolved. You can mark the conflict as
52 + resolved with `git add <filename>`. After resolving all of the conflicts,
53 + you can continue the rebasing process with
54 +
55 + git rebase --continue
56 +
57 +2. Stop the `git rebase` and return your branch to its original state with
58 +
59 + git rebase --abort
60 +
61 +3. Skip the commit that caused the merge conflict with
62 +
63 + git rebase --skip
64 +
65 If `<branch>` is specified, `git rebase` will perform an automatic
66 `git switch <branch>` before doing anything else. Otherwise
67 it remains on the current branch.
@@ -77,13 +97,6 @@ any commits in `HEAD` which introduce the same textual changes as a commit
97 in `HEAD..<upstream>` are omitted (i.e., a patch already accepted upstream
98 with a different commit message or timestamp will be skipped).
99
80 -It is possible that a merge failure will prevent this process from being
81 -completely automatic. You will have to resolve any such merge failure
82 -and run `git rebase --continue`. Another option is to bypass the commit
83 -that caused the merge failure with `git rebase --skip`. To check out the
84 -original `<branch>` and remove the `.git/rebase-apply` working files, use
85 -the command `git rebase --abort` instead.
86 -
100 If the upstream branch already contains a change you have made (e.g.,
101 because you mailed a patch which was applied upstream), then that commit
102 will be skipped and warnings will be issued (if the 'merge' backend is
@@ -186,28 +199,6 @@ This is useful if F and G were flawed in some way, or should not be
199 part of topicA. Note that the argument to `--onto` and the `<upstream>`
200 parameter can be any valid commit-ish.
201
189 -In case of conflict, `git rebase` will stop at the first problematic commit
190 -and leave conflict markers in the tree. You can use `git diff` to locate
191 -the markers (<<<<<<) and make edits to resolve the conflict. For each
192 -file you edit, you need to tell Git that the conflict has been resolved,
193 -typically this would be done with
194 -
195 -
196 - git add <filename>
197 -
198 -
199 -After resolving the conflict manually and updating the index with the
200 -desired resolution, you can continue the rebasing process with
201 -
202 -
203 - git rebase --continue
204 -
205 -
206 -Alternatively, you can undo the 'git rebase' with
207 -
208 -
209 - git rebase --abort
210 -
202 MODE OPTIONS
203 ------------
204