summaryrefslogtreecommitdiff
path: root/Documentation/git-checkout.txt
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2008-08-31 19:32:40 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2008-08-31 20:09:21 -0700
commiteac5a401512181cd315a1031af2b8a25430e335a (patch)
tree246e7b22c653c94af9a0cd615281b92e39fda902 /Documentation/git-checkout.txt
parentcheckout -m: recreate merge when checking out of unmerged index (diff)
downloadtgif-eac5a401512181cd315a1031af2b8a25430e335a.tar.xz
checkout --conflict=<style>: recreate merge in a non-default style
This new option does essentially the same thing as -m option when checking unmerged paths out of the index, but it uses the specified style instead of configured merge.conflictstyle. Setting "merge.conflictstyle" to "diff3" is usually less useful than using the default "merge" style, because the latter allows a conflict that results by both sides changing the same region in a very similar way to get simplified substancially by reducing the common lines. However, when one side removed a group of lines (perhaps a function was moved to some other file) while the other side modified it, the default "merge" style does not give any clue as to why the hunk is left conflicting. You would need the original to understand what is going on. The recommended use would be not to set merge.conflictstyle variable so that you would usually use the default "merge" style conflict, and when the result in a path in a particular merge is too hard to understand, use "git checkout --conflict=diff3 $path" to check it out with the original to review what is going on. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/git-checkout.txt')
-rw-r--r--Documentation/git-checkout.txt10
1 files changed, 9 insertions, 1 deletions
diff --git a/Documentation/git-checkout.txt b/Documentation/git-checkout.txt
index c884862e2f..13b106d626 100644
--- a/Documentation/git-checkout.txt
+++ b/Documentation/git-checkout.txt
@@ -9,7 +9,7 @@ SYNOPSIS
--------
[verse]
'git checkout' [-q] [-f] [[--track | --no-track] -b <new_branch> [-l]] [-m] [<branch>]
-'git checkout' [-f|--ours|--theirs|-m] [<tree-ish>] [--] <paths>...
+'git checkout' [-f|--ours|--theirs|-m|--conflict=<style>] [<tree-ish>] [--] <paths>...
DESCRIPTION
-----------
@@ -84,6 +84,7 @@ entries; instead, unmerged entries are ignored.
based sha1 expressions such as "<branchname>@\{yesterday}".
-m::
+--merge::
When switching branches,
if you have local modifications to one or more files that
are different between the current branch and the branch to
@@ -101,6 +102,13 @@ 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.
+--conflict=<style>::
+ The same as --merge option above, but changes the way the
+ conflicting hunks are presented, overriding the
+ merge.conflictstyle configuration variable. Possible values are
+ "merge" (default) and "diff3" (in addition to what is shown by
+ "merge" style, shows the original contents).
+
<new_branch>::
Name for the new branch.