From: Junio C Hamano Date: Tue, 14 Apr 2026 20:34:01 +0000 (-0700) Subject: Revert "Merge branch 'hn/git-checkout-m-with-stash' into next" X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=af818d63126afcfc708b23eb0e5cc66a99274b54;p=thirdparty%2Fgit.git Revert "Merge branch 'hn/git-checkout-m-with-stash' into next" This reverts commit b4e5a964fa85a84a9328647486c250706ad6501d, reversing changes made to 0e6c98f313ae3e75cedad7125c9b4ab3ba1065c2, as the topic is still getting rerolled. --- diff --git a/Documentation/git-checkout.adoc b/Documentation/git-checkout.adoc index 70dd211ee3..43ccf47cf6 100644 --- a/Documentation/git-checkout.adoc +++ b/Documentation/git-checkout.adoc @@ -251,19 +251,20 @@ working tree, by copying them from elsewhere, extracting a tarball, etc. are different between the current branch and the branch to which you are switching, the command refuses to switch branches in order to preserve your modifications in context. - With this option, the conflicting local changes are - automatically stashed before the switch and reapplied - afterwards. If the local changes do not overlap with the - differences between branches, the switch proceeds without - stashing. If reapplying the stash results in conflicts, the - entry is saved to the stash list. Resolve the conflicts - and run `git stash drop` when done, or clear the working - tree (e.g. with `git reset --hard`) before running `git stash - pop` later to re-apply your changes. + However, with this option, a three-way merge between the current + branch, your working tree contents, and the new branch + is done, and you will be on the new branch. ++ +When a merge conflict happens, the index entries for conflicting +paths are left unmerged, and you need to resolve the conflicts +and mark the resolved paths with `git add` (or `git rm` if the merge +should result in deletion of the path). + When checking out paths from the index, this option lets you recreate the conflicted merge in the specified paths. This option cannot be used when checking out paths from a tree-ish. ++ +When switching branches with `--merge`, staged changes may be lost. `--conflict=