Article View: linux.kernel.git
Article #1518[PATCH v5 2/6] doc: git-merge: link to new merge conflicts guide
From: "Julia Evans via GitGitGadget"
Date: Mon, 26 Oct 2026 12:40
Date: Mon, 26 Oct 2026 12:40
162 lines
17128 bytes
17128 bytes
From: Julia Evans <julia@jvns.ca> All of the info about merge conflicts has been moved to the new guide Signed-off-by: Julia Evans <julia@jvns.ca> --- Documentation/git-merge.adoc | 125 +---------------------------------- 1 file changed, 3 insertions(+), 122 deletions(-) diff --git a/Documentation/git-merge.adoc b/Documentation/git-merge.adoc index a055384ad6..5b7b41cd10 100644 --- a/Documentation/git-merge.adoc +++ b/Documentation/git-merge.adoc @@ -49,7 +49,8 @@ a log message from the user describing the changes. Before the operation, A merge stops if there's a conflict that cannot be resolved automatically or if `--no-commit` was provided when initiating the merge. At that point you can run `git merge --abort` or `git merge ---continue`. +--continue`. See linkgit:gitmergeconflicts[7] +(or `git help mergeconflicts`) for a guide to handling merge conflicts. `git merge --abort` will abort the merge process and try to reconstruct the pre-merge state. However, if there were uncommitted changes when the @@ -231,127 +232,6 @@ git merge v1.2.3^0 git merge --ff-only v1.2.3 ---- -HOW CONFLICTS ARE PRESENTED ---------------------------- - -During a merge, the working tree files are updated to reflect the result -of the merge. Among the changes made to the common ancestor's version, -non-overlapping ones (that is, you changed an area of the file while the -other side left that area intact, or vice versa) are incorporated in the -final result verbatim. When both sides made changes to the same area, -however, Git cannot randomly pick one side over the other, and asks you to -resolve it by leaving what both sides did to that area. - -By default, Git uses the same style as the one used by the "merge" program -from the RCS suite to present such a conflicted hunk, like this: - ------------- -Here are lines that are either unchanged from the common -ancestor, or cleanly resolved because only one side changed, -or cleanly resolved because both sides changed the same way. -<<<<<<< yours:sample.txt -Conflict resolution is hard; -let's go shopping. -======= -Git makes conflict resolution easy. ->>>>>>> theirs:sample.txt -And here is another line that is cleanly resolved or unmodified. ------------- - -The area where a pair of conflicting changes happened is marked with markers -+<<<<<<<+, `=======`, and +>>>>>>>+. The part before the `=======` -is typically your side, and the part afterwards is typically their side. - -The default format does not show what the original said in the conflicting -area. You cannot tell how many lines are deleted and replaced with -Barbie's remark on your side. The only thing you can tell is that your -side wants to say it is hard and you'd prefer to go shopping, while the -other side wants to claim it is easy. - -An alternative style can be used by setting the `merge.conflictStyle` -configuration variable to either `diff3` or `zdiff3`. In `diff3` -style, the above conflict may look like this: - ------------- -Here are lines that are either unchanged from the common -ancestor, or cleanly resolved because only one side changed, -<<<<<<< yours:sample.txt -or cleanly resolved because both sides changed the same way. -Conflict resolution is hard; -let's go shopping. -||||||| base:sample.txt -or cleanly resolved because both sides changed identically. -Conflict resolution is hard. -======= -or cleanly resolved because both sides changed the same way. -Git makes conflict resolution easy. ->>>>>>> theirs:sample.txt -And here is another line that is cleanly resolved or unmodified. ------------- - -while in `zdiff3` style, it may look like this: - ------------- -Here are lines that are either unchanged from the common -ancestor, or cleanly resolved because only one side changed, -or cleanly resolved because both sides changed the same way. -<<<<<<< yours:sample.txt -Conflict resolution is hard; -let's go shopping. -||||||| base:sample.txt -or cleanly resolved because both sides changed identically. -Conflict resolution is hard. -======= -Git makes conflict resolution easy. ->>>>>>> theirs:sample.txt -And here is another line that is cleanly resolved or unmodified. ------------- - -In addition to the +<<<<<<<+, `=======`, and +>>>>>>>+ markers, it uses -another +|||||||+ marker that is followed by the original text. You can -tell that the original just stated a fact, and your side simply gave in to -that statement and gave up, while the other side tried to have a more -positive attitude. You can sometimes come up with a better resolution by -viewing the original. - - -HOW TO RESOLVE CONFLICTS ------------------------- - -After seeing a conflict, you can do two things: - - * Decide not to merge. The only clean-ups you need are to reset - the index file to the `HEAD` commit to reverse 2. and to clean - up working tree changes made by 2. and 3.; `git merge --abort` - can be used for this. - - * Resolve the conflicts. Git will mark the conflicts in - the working tree. Edit the files into shape and - `git add` them to the index. Use `git commit` or - `git merge --continue` to seal the deal. The latter command - checks whether there is a (interrupted) merge in progress - before calling `git commit`. - -You can work through the conflict with a number of tools: - - * Use a mergetool. `git mergetool` to launch a graphical - mergetool which will work through the merge with you. - - * Look at the diffs. `git diff` will show a three-way diff, - highlighting changes from both the `HEAD` and `MERGE_HEAD` - versions. `git diff AUTO_MERGE` will show what changes you've - made so far to resolve textual conflicts. - - * Look at the diffs from each branch. `git log --merge -p <path>` - will show diffs first for the `HEAD` version and then the - `MERGE_HEAD` version. - - * Look at the originals. `git show :1:filename` shows the - common ancestor, `git show :2:filename` shows the `HEAD` - version, and `git show :3:filename` shows the `MERGE_HEAD` - version. - - EXAMPLES -------- @@ -406,6 +286,7 @@ linkgit:git-reset[1], linkgit:git-diff[1], linkgit:git-ls-files[1], linkgit:git-add[1], linkgit:git-rm[1], linkgit:git-mergetool[1] +linkgit:gitmergeconflicts[7] GIT --- -- gitgitgadget
Technical Details
Message-ID:
<3dc763a2a2f10f453102ad3b9232d9291e7cca75.1793018405.git.gitgitgadget@gmail.com>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!git+bounces-73322-linux-kernel-git=dewy.ruReferences:
<pull.2237.git.1790261062.gitgitgadget@gmail.com> <pull.2237.v5.git.1793018405.gitgitgadget@gmail.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!git+bounces-73322-linux-kernel-git=dewy.ru
From: gitgitgadget@gmail.com ("Julia Evans via GitGitGadget")
Newsgroups: linux.kernel.git
Subject: [PATCH v5 2/6] doc: git-merge: link to new merge conflicts guide
Date: Mon, 26 Oct 2026 12:40:01 +0000
Organization: Usenet Network
Message-ID: <3dc763a2a2f10f453102ad3b9232d9291e7cca75.1793018405.git.gitgitgadget@gmail.com>
References: <pull.2237.git.1790261062.gitgitgadget@gmail.com>
<pull.2237.v5.git.1793018405.gitgitgadget@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
logging-data="1307849"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:xQyRyyVUSeGuGm5Y+fdyF/CePb4= sha256:2xFYIO7MRR3SKyit2IQXWwZRtaSCXzA92RKdfXbfYuw=
sha1:9xpNP7bDPI5qDJhREMJYQeX9448= sha256:W+dkxDVfba6NQnshs3irF/dmm118UJ9U1o6yf8gtGdI=
List-ID: <git.vger.kernel.org>
X-Received: from localhost (localhost [127.0.0.1])
by mail.dewy.ru (Postfix) with ESMTP id 3D6B0125BA4; Mon, 26 Oct 2026 15:55:03 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: 1.61
X-Spam-Level: *
X-Spam-Status: No, score=1.61 tagged_above=-9999 required=6.31
tests=[DCC_CHECK=1.1, DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1,
DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001,
FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25,
MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_SBL_CSS=3.558,
SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=no autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
header.d=gmail.com
X-Received: from mail.dewy.ru ([127.0.0.1])
by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
with ESMTP id 30PkgTGsKtkz;
Mon, 26 Oct 2026 15:55:00 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=104.64.211.4; helo=sin.lore.kernel.org; envelope-from=git+bounces-73322-linux-kernel-git=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=gmail.com
X-Received: from sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4])
by mail.dewy.ru (Postfix) with ESMTPS id 85511125BA8; Mon, 26 Oct 2026 15:54:51 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
by sin.lore.kernel.org (Postfix) with ESMTP id 1E87029B62; Mon, 26 Oct 2026 12:40:15 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
t=1793018412;
b=sRS6W9Aq/rCWcd3kyXpDhCQUm4kAFZWvTpfbiRMhBQ33fTw4AFmr436xyrmUGF6SQOIO
U3tNr6GMtZ3B8QxthxpnnzDU3PK+CEVDf49fI/FZxlrt5XZHzAGKSkpIyY03KC3JHW289
pVU9LcN8WafwGRqUUheTbo5GoeXMD6VBrrjEj+dxYlevnQWdgZAvI2lmzdDWLYdik1CJU
rmXYBZCdGWt2KdIi6hFD4optraI+sJkoqOkeMEmYlGiuI6hSGUWhNrO/b3n8JfsTmHj/h
1QDNEJnSjUX91KkXhRqQUpKV8B3pplnEVnBGKRj202AEUMItyPtdebFaGpKY+kutJLg==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1793018412;
h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
X-Google-DKIM-Signature:X-Gm-Message-State:X-Gm-Gg:X-Received:
Received:Message-Id:In-Reply-To:References:From:Date:Subject:Fcc:
Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id:
List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner:
Precedence:MIME-Version:To:Cc;
bh=n7Uh+pWqPKvAUTaGhd5kOTyN5HRS0QYmdbI4NNYYCM8=;
b=nqoTxmCkRmqX5ORBSTHDLxACnyshCqnJ2KKcS5BeRWat+5HxXsJUqBy/QfSbAiL9xIBD
NoZGUTzTR0+OntkWa/WmoUASYtvY46TZIB849qGPxh/Nbyhkqd0BGXZW94EmAgWK6GS7T
g6UjzQ0zsgAOZePHCMpYMtDf8Smhgg/ujx9CoRT8GMHdOnRb8k4ak2iQcHhNTsDPpY4Ux
DeSDrbDifKO9ISyR6VfpvA7B2FYPga/q/w6KDR7xbmv0Y5bBr6BwWwIozlWmmrcmXEj/8
uMloKPcLtiNn7SYPfzbpfOF23u2jqWlo+TzkuSzkyzht5qx20zBjpr4rUjmvXutnojA==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org;
dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104 header.b=mmWAyScC;
dmarc=pass header.from=gmail.com;
spf=pass smtp.mailfrom=gmail.com;
arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id 3AAA4606A32C;
Mon, 26 Oct 2026 12:40:12 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104 header.b=mmWAyScC
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.218.53
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
t=1793018411;
b=kRUR5bGFmN5xBRbHs4QB5E6CgLcrEB/7SQmboRjUR3LO7ndIPky2Rwq+qCk8eR2sRMR5
49A5i4iNMyB1deDi6xKibJg7XPpeTqTcfF294Mvcat66GwGUyD/qPHB5qDDFADc/tg/EH
vCZgR+PbeemQ8/urfQ16TAZtHZcYBp3ItD934q24yvYwVAJeBjRKTZLP10czIC42MuvqI
lthkDfuWL2ixdEyFIzb/KpxnSkeWPJa1j/3F2v9CLKZFQyM5yrSYcFvo+JEA5XYjSBVvj
kiRMu2qm4YO2tj9OqS2xKr/q6ZCqsliN8pxTWsi/ioXrAENftQ1DfYDXct/V+Is1Hdw==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1793018411;
h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
X-Gm-Message-State:X-Gm-Gg:X-Received:Received:Message-Id:In-Reply-To:
References:From:Date:Subject:Fcc:Content-Type:
Content-Transfer-Encoding:MIME-Version:To:Cc;
bh=n7Uh+pWqPKvAUTaGhd5kOTyN5HRS0QYmdbI4NNYYCM8=;
b=khGOGebg7rsUhYDxOaOGgekssaf0QgJYRITEXLi3Fd5zuMJANliRhGbqrIsQghQyx6dD
vLdvaA0YZhMXY/zOLXgyEHSu9Ah6Wr2QeKBC1iPpXhASXTIhw6CzvVXNWvkpynGG///PG
SLc8DA6hROYG1K9LXzn/sx5OhvsuPQiOJJ8UsW2fU6+RrHGBv72ll7i0V/aZPWOVuXgMc
hPLLHSWJ2fX33kZPeXJet28Sq8gMCQXx1SbbLKA9zEgrjtmQplt/AXvVE9XQO2kxOdiUu
F18yR7orywYGgQp/xIezRfST182b6CFBz2JzRvYx7GU0gmk6A2PzY83SHNDo0aVwlvA==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org;
dmarc=pass header.from=gmail.com;
spf=pass smtp.mailfrom=gmail.com;
dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104 header.b=mmWAyScC;
arc=none smtp.remote-ip=209.85.218.53
X-Received: from mail-ej1-f53.google.com (mail-ej1-f53.google.com [209.85.218.53])
(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id 08609606A31B
for <git@vger.kernel.org>; Mon, 26 Oct 2026 12:40:10 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 08609606A31B
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com
X-Received: by mail-ej1-f53.google.com with SMTP id a640c23a62f3a-c445c95d553so376282066b.1
for <git@vger.kernel.org>; Mon, 26 Oct 2026 05:40:10 -0700 (PDT)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20251104; t=1793018409; x=1793623209; darn=vger.kernel.org;
h=cc:to:mime-version:content-transfer-encoding:content-type:fcc
:subject:date:from:references:in-reply-to:message-id:from:to:cc
:subject:date:message-id:reply-to:content-type;
bh=n7Uh+pWqPKvAUTaGhd5kOTyN5HRS0QYmdbI4NNYYCM8=;
b=mmWAyScCVx3Jkav+NjAtsvMyEDalvBoNxpfFeNOHyMoZegVFt+c5ohceiVwMfbETks
UcP/lAw0jqtaWtr2GxEc0+MFSR9mgTyd0GhFdaylOk+F1uJ2cca4KTVgA8oiNaey815C
DKKD+DtNGpP8UvLeqLR5aflC40FBDB3rSiR4FOvXr6a7Lo2XjJIxuULCmR7TzOjDHQBS
QvSzy9ZkK6rujsZIasrl9fU0RBp+gkRTG27/oVryh+ZikNy1XHPkIbc+FcJoPD/1da0i
k7uveacRvnOP7t8m+zgbyZHDOMGcaQUnkW7Q0LDMttjU6So8mCJJs3SFidwcBVx9OJ0Y
1D2Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20260707; t=1793018409; x=1793623209;
h=cc:to:mime-version:content-transfer-encoding:content-type:fcc
:subject:date:from:references:in-reply-to:message-id:x-gm-gg
:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
:content-type;
bh=n7Uh+pWqPKvAUTaGhd5kOTyN5HRS0QYmdbI4NNYYCM8=;
b=WClFkdbC7BBkjTKLkoSBOPcsuBLxZN4OEnWWTX9YqvahTQ2wQd2vpBg06Np2BLkdSj
9WekERbh1LyO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f3a-c46bdaa744dmr759808966b.1.1793018409270;
Mon, 26 Oct 2026 05:40:09 -0700 (PDT)
X-Received: from [127.0.0.1] ([172.174.191.59])
by smtp.gmail.com with ESMTPSA id a640c23a62f3a-c46bd4ea351sm313694266b.28.2026.10.26.05.40.08
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Mon, 26 Oct 2026 05:40:08 -0700 (PDT)
X-In-Reply-To: <pull.2237.v5.git.1793018405.gitgitgadget@gmail.com>
X-Fcc: Sent
X-Mailing-List: git@vger.kernel.org
X-List-Post: <mailto:git@vger.kernel.org>
X-List-Help: <mailto:git+help@vger.kernel.org>
X-List-Subscribe: <mailto:git+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:git+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:git+owner@vger.kernel.org>
X-Precedence: list
X-Cc: ps@pks.im,
Jeff King <peff@peff.net>,
"D. Ben Knoble" <ben.knoble@gmail.com>,
Julia Evans <julia@jvns.ca>,
Julia Evans <julia@jvns.ca>