From: Simon A. Eugster Date: Fri, 10 Jul 2015 08:27:57 GMT Subject: [PATCH] Documentation clarification on git-checkout regarding ours/theirs Message-ID: <1436516877-21064-1-git-send-email-simon.eu@gmail.com> From: "Simon A. Eugster" Signed-off-by: Simon A. Eugster --- Documentation/git-checkout.txt | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/Documentation/git-checkout.txt b/Documentation/git-checkout.txt index d263a56..d69306f 100644 --- a/Documentation/git-checkout.txt +++ b/Documentation/git-checkout.txt @@ -115,7 +115,21 @@ entries; instead, unmerged entries are ignored. --ours:: --theirs:: When checking out paths from the index, check out stage #2 - ('ours') or #3 ('theirs') for unmerged paths. + ('ours', HEAD) or #3 ('theirs', MERGE_HEAD) for unmerged paths. + See linkgit:git-merge[1] for details about stages #2 and #3. ++ +Note that during `git rebase` and `git pull --rebase`, 'theirs' checks out +the local version, and 'ours' the remote version or the history that is rebased +against. ++ +The reason ours/theirs appear to be swapped during a rebase is that we +define the remote history as the canonical history, on top of which our +private commits are applied on, as opposed to normal merging where the +local history is the canonical one. +During merging, we assume the role of the canonical history’s keeper, +which, in case of a rebase, is the remote history, and our private commits +look to the keeper as “their” commits which need to be integrated on top +of “our” work. -b :: Create a new branch named and start it at -- 1.8.5.1