From: Patrick Steinhardt <ps@pks.im>
To: Julia Evans via GitGitGadget <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org, Jeff King <peff@peff.net>,
"D. Ben Knoble" <ben.knoble@gmail.com>,
Julia Evans <julia@jvns.ca>
Subject: Re: [PATCH v3 1/6] doc: add new gitmergeconflicts man page
Date: Tue, 13 Oct 2026 13:07:45 +0200 [thread overview]
Message-ID: <as4RAcQxknZXcBVd@pks.im> (raw)
In-Reply-To: <7aa0ae7ec3c1d02aa1533c27fa40f4815c03ba6e.1791816795.git.gitgitgadget@gmail.com>
On Mon, Oct 12, 2026 at 02:53:10PM +0000, Julia Evans via GitGitGadget wrote:
> diff --git a/Documentation/gitmergeconflicts.adoc b/Documentation/gitmergeconflicts.adoc
> new file mode 100644
> index 0000000000..3c6eaaddf8
> --- /dev/null
> +++ b/Documentation/gitmergeconflicts.adoc
> @@ -0,0 +1,330 @@
> +gitmergeconflicts(7)
> +====================
> +
> +NAME
> +----
> +gitmergeconflicts - Guide to handling merge conflicts
> +
> +DESCRIPTION
> +-----------
> +
> +Merge conflicts can happen during a `git merge`, `git rebase`, `git
> +cherry-pick`, `git pull`, `git revert`, or any other command that does
> +a merge. All of those commands use the same merge algorithm, and the
> +process for resolving a merge conflict is always very similar.
> +
> +There are 3 ways to handle a merge conflict:
> +
> +* Resolve the conflict. (see <<resolve,HOW TO RESOLVE A MERGE CONFLICT>>
> + below for details)
> +* Stop the operation and return your branch to its original state
> + with the appropriate `--abort` command, for example `git merge --abort`
> + or `git rebase --abort`. See <<git_status,EXAMPLE: GIT STATUS OUTPUT>> below
> + for how to find the command to run.
> +* Or (if you're in a multi-step rebase or cherry-pick) skip the problematic
> + commit with the appropriate `--skip` command
Nit: the punctuation is a bit inconsistent, where the second bullet
point has a trailing punctuation mark but the other two don't.
> +WHAT IS A MERGE CONFLICT?
> +-------------------------
> +
> +When Git merges two commits together, it looks at the changes that
> +each side has made and combines those changes. For example, if one side
> +edited lines 1-5 of `hello.py` and the other side edited lines 20-25 of
> +the same file, then it can easily combine them since there's no overlap.
> +
> +But if both sides edited overlapping lines of the same file (for example
> +one side edited lines 1-5 and the other edited lines 3-6), Git will
> +not try to guess how to combine those changes. This is called a "merge
> +conflict".
> +
> +When this happens, Git shows you both sides' edits and asks you to pick
> +how to resolve them. It:
> +
> +* Stages all of the files which were successfully merged
> +* For the files with conflicts, it marks them as conflicted, puts both
> + sides' edits in the file, and leaves <<markers, merge conflict markers>>
> + that you need to resolve.
Same nit here.
> +[NOTE]
> +================================
> +Even if Git successfully merges both sides with no conflicts, it's
> +possible to end up with code that doesn't work. For example, this can
> +happen if one side renames a function, and the other side adds a call to
> +the old function. This is called a "semantic merge conflict".
> +================================
Good callout. We may also want to spell out the consequence of this:
"You should always verify the result of a merge regardless of whether or
not it has resulted in a conflict.".
> +[[resolve]]
> +HOW TO RESOLVE A MERGE CONFLICT
> +-------------------------------
> +
> +The process for resolving a merge conflict is:
> +
> +1. Run `git status` to get a list of files with merge conflicts
> +2. For each one, find the conflict markers
> + (the `<<<<<<<`, `=======`, `>>>>>>>`) and edit the code to
> + fix the conflict
> +3. Run `git add FILENAME` for each file to mark the conflict as resolved
> +4. Run the appropriate `--continue` command to continue the operation
> + that was interrupted by the conflict, for example `git merge --continue`
> + or `git rebase --continue`. See <<git_status,EXAMPLE: GIT STATUS OUTPUT>>
> + below for how to find the command to run.
Same nit regarding punctuation. Or is this actually a thing, where you
add punctuation in case it's multiple sentences but not in the case
where it's a single sentence, only? Maybe this is just me not being a
native speaker.
> +[[tools]]
> +TOOLS FOR HANDLING MERGE CONFLICTS
> +----------------------------------
> +
> +Here are some ways to get extra context while handling a merge conflict:
> +
> +* There are many graphical "merge tools" for Git, which will normally
> + show you the different versions of the code side by side.
> + If you have a mergetool configured, `git mergetool` will launch it.
> + See also `merge.tool` in linkgit:git-config[1] for a list of
> + the mergetools Git supports.
> +
> +* You can set the configuration variable `merge.conflictstyle=diff3`.
> + See <<diff3,DIFF3>> below for more.
> +
> +* `git log --merge -p <filename>` will list all commits which
Should we spell this out as `--patch` instead? That's way easier to grep
in the manpage in case the reader is curious what the option does.
> +[NOTE]
> +================================
> +`zdiff3` is an alternative to `diff3` that makes the merge conflict
> +shorter by making it more ambiguous.
> +================================
"making it more ambiguous" reads rather curious. Should we maybe take
inspiration from its documentation and instead say "by removing matching
lines on the two sides from the beginning or end of a conflict region"?
> +[[ours]]
> +"OURS" AND "THEIRS"
> +-------------------
> +
> +Sometimes during a merge conflict, Git will use the terms "ours" and
> +"theirs" (or "us" and "them"). For example, `git status` might say that
> +a file was `deleted by us`.
> +
> +"Ours" and "theirs" are both commits: "ours" is the current
> +`HEAD` commit, and "theirs" is the other side being merged.
They may not always be commits, but they are always tree-ishs. But I
think it's fine to leave this as-is anyway, as the normal user is never
going to encounter cases where it's not in fact a commit. And when they
do they probably don't need this manpage anyway.
Other than this handful of nits I'm happy with this version, thanks!
Patrick
next prev parent reply other threads:[~2026-10-13 11:07 UTC|newest]
Thread overview: 83+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-24 14:44 [PATCH 0/7] [doc] Add new page on merge conflicts Julia Evans via GitGitGadget
2026-09-24 14:44 ` [PATCH 1/7] [doc] Add new gitmergeconflicts man page Julia Evans via GitGitGadget
2026-09-24 20:36 ` Junio C Hamano
2026-09-24 22:04 ` Junio C Hamano
2026-09-30 13:19 ` Patrick Steinhardt
2026-09-30 19:53 ` Julia Evans
2026-09-30 20:37 ` Junio C Hamano
2026-10-01 5:14 ` Patrick Steinhardt
2026-10-01 12:10 ` Julia Evans
2026-10-02 17:58 ` Junio C Hamano
2026-10-05 16:54 ` Julia Evans
2026-10-05 17:22 ` Junio C Hamano
2026-10-05 19:11 ` Julia Evans
2026-09-24 14:44 ` [PATCH 2/7] [doc] git-merge: link to new merge conflicts guide Julia Evans via GitGitGadget
2026-09-25 16:36 ` D. Ben Knoble
2026-09-25 16:59 ` Julia Evans
2026-09-25 18:19 ` Junio C Hamano
2026-09-25 19:32 ` Ben Knoble
2026-09-25 21:49 ` Junio C Hamano
2026-09-25 19:34 ` Ben Knoble
2026-10-02 17:01 ` Julia Evans
2026-10-02 17:50 ` Junio C Hamano
2026-10-02 18:53 ` Julia Evans
2026-10-02 21:38 ` Junio C Hamano
2026-10-03 2:25 ` D. Ben Knoble
2026-10-03 4:12 ` Junio C Hamano
2026-09-30 13:19 ` Patrick Steinhardt
2026-09-24 14:44 ` [PATCH 3/7] [doc] git-rebase: " Julia Evans via GitGitGadget
2026-09-24 14:44 ` [PATCH 4/7] [doc] git-revert: " Julia Evans via GitGitGadget
2026-09-24 14:44 ` [PATCH 5/7] [doc] git-cherry-pick: " Julia Evans via GitGitGadget
2026-09-25 17:17 ` Junio C Hamano
2026-09-28 20:58 ` Julia Evans
2026-09-28 21:25 ` Junio C Hamano
2026-09-24 14:44 ` [PATCH 6/7] [doc] git-pull: " Julia Evans via GitGitGadget
2026-09-24 14:44 ` [PATCH 7/7] [doc] ignore conflict markers in gitmergeconflicts.adoc Julia Evans via GitGitGadget
2026-10-07 21:21 ` Junio C Hamano
2026-10-09 12:06 ` Julia Evans
2026-09-24 22:20 ` [PATCH 0/7] [doc] Add new page on merge conflicts Junio C Hamano
2026-09-24 23:37 ` Jeff King
2026-09-28 20:41 ` Julia Evans
2026-09-29 1:32 ` Jeff King
2026-09-29 1:56 ` Junio C Hamano
2026-09-25 16:25 ` D. Ben Knoble
2026-10-02 17:39 ` Julia Evans
2026-10-03 2:29 ` D. Ben Knoble
2026-10-05 18:49 ` Julia Evans
2026-10-06 16:53 ` D. Ben Knoble
2026-10-06 17:09 ` D. Ben Knoble
2026-10-09 12:00 ` [PATCH v2 0/6] " Julia Evans via GitGitGadget
2026-10-09 12:00 ` [PATCH v2 1/6] doc: add new gitmergeconflicts man page Julia Evans via GitGitGadget
2026-10-09 17:58 ` Junio C Hamano
2026-10-09 18:53 ` Julia Evans
2026-10-09 21:54 ` Junio C Hamano
2026-10-10 1:45 ` Junio C Hamano
2026-10-09 12:00 ` [PATCH v2 2/6] doc: git-merge: link to new merge conflicts guide Julia Evans via GitGitGadget
2026-10-09 18:20 ` Junio C Hamano
2026-10-09 12:00 ` [PATCH v2 3/6] doc: git-rebase: " Julia Evans via GitGitGadget
2026-10-09 18:22 ` Junio C Hamano
2026-10-09 12:00 ` [PATCH v2 4/6] doc: git-revert: " Julia Evans via GitGitGadget
2026-10-09 18:24 ` Junio C Hamano
2026-10-09 12:00 ` [PATCH v2 5/6] doc: git-cherry-pick: " Julia Evans via GitGitGadget
2026-10-09 18:26 ` Junio C Hamano
2026-10-09 20:12 ` Julia Evans
2026-10-09 12:00 ` [PATCH v2 6/6] doc: git-pull: " Julia Evans via GitGitGadget
2026-10-09 18:27 ` Junio C Hamano
2026-10-09 15:41 ` [PATCH v2 0/6] [doc] Add new page on merge conflicts Junio C Hamano
2026-10-09 15:53 ` Julia Evans
2026-10-09 22:10 ` Ben Knoble
2026-10-09 18:36 ` Junio C Hamano
2026-10-12 14:53 ` [PATCH v3 " Julia Evans via GitGitGadget
2026-10-12 14:53 ` [PATCH v3 1/6] doc: add new gitmergeconflicts man page Julia Evans via GitGitGadget
2026-10-12 18:16 ` Junio C Hamano
2026-10-13 11:07 ` Patrick Steinhardt [this message]
2026-10-12 14:53 ` [PATCH v3 2/6] doc: git-merge: link to new merge conflicts guide Julia Evans via GitGitGadget
2026-10-12 14:53 ` [PATCH v3 3/6] doc: git-rebase: " Julia Evans via GitGitGadget
2026-10-12 14:53 ` [PATCH v3 4/6] doc: git-revert: " Julia Evans via GitGitGadget
2026-10-12 14:53 ` [PATCH v3 5/6] doc: git-cherry-pick: " Julia Evans via GitGitGadget
2026-10-13 11:07 ` Patrick Steinhardt
2026-10-12 14:53 ` [PATCH v3 6/6] doc: git-pull: " Julia Evans via GitGitGadget
2026-10-12 15:53 ` [PATCH v3 0/6] [doc] Add new page on merge conflicts D. Ben Knoble
2026-10-12 20:44 ` Julia Evans
2026-10-12 18:17 ` Junio C Hamano
2026-10-12 18:37 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=as4RAcQxknZXcBVd@pks.im \
--to=ps@pks.im \
--cc=ben.knoble@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=julia@jvns.ca \
--cc=peff@peff.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox