path: root/Documentation
diff options
authorJunio C Hamano <>2008-08-30 14:52:24 (GMT)
committerJunio C Hamano <>2008-08-31 02:57:55 (GMT)
commit0cf8581e330e7140c9f5c94a53d441187c0f8ff9 (patch)
treea1e46a0198f62914d29e8e1429b8efce58ada4ee /Documentation
parent29a1f99b4b81cd28163de1275265234c5ab804b4 (diff)
checkout -m: recreate merge when checking out of unmerged index
This teaches git-checkout to recreate a merge out of unmerged index entries while resolving conflicts. With this patch, checking out an unmerged path from the index now have the following possibilities: * Without any option, an attempt to checkout an unmerged path will atomically fail (i.e. no other cleanly-merged paths are checked out either); * With "-f", other cleanly-merged paths are checked out, and unmerged paths are ignored; * With "--ours" or "--theirs, the contents from the specified stage is checked out; * With "-m" (we should add "--merge" as synonym), the 3-way merge is recreated from the staged object names and checked out. Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'Documentation')
1 files changed, 8 insertions, 3 deletions
diff --git a/Documentation/git-checkout.txt b/Documentation/git-checkout.txt
index a9ca2f5..c884862 100644
--- a/Documentation/git-checkout.txt
+++ b/Documentation/git-checkout.txt
@@ -9,7 +9,7 @@ SYNOPSIS
'git checkout' [-q] [-f] [[--track | --no-track] -b <new_branch> [-l]] [-m] [<branch>]
-'git checkout' [-f|--ours|--theirs] [<tree-ish>] [--] <paths>...
+'git checkout' [-f|--ours|--theirs|-m] [<tree-ish>] [--] <paths>...
@@ -35,7 +35,8 @@ default, if you try to check out such an entry from the index, the
checkout operation will fail and nothing will be checked out.
Using -f will ignore these unmerged entries. The contents from a
specific side of the merge can be checked out of the index by
-using --ours or --theirs.
+using --ours or --theirs. With -m, changes made to the working tree
+file can be discarded to recreate the original conflicted merge result.
@@ -83,7 +84,8 @@ entries; instead, unmerged entries are ignored.
based sha1 expressions such as "<branchname>@\{yesterday}".
- If you have local modifications to one or more files that
+ When switching branches,
+ if you have local modifications to one or more files that
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.
@@ -95,6 +97,9 @@ 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.
Name for the new branch.