path: root/Documentation/git-checkout.txt
diff options
authorJunio C Hamano <>2008-08-31 02:44:17 (GMT)
committerJunio C Hamano <>2008-08-31 02:44:26 (GMT)
commit29a1f99b4b81cd28163de1275265234c5ab804b4 (patch)
tree8179b07340733b5e447b81117a9d82e651d8315c /Documentation/git-checkout.txt
parentc236bcd06138bcbc929b86ad1a513635bf4847b2 (diff)
parent38901a48375952ab6c02f22bddfa19ac2bec2c36 (diff)
Merge branch 'jc/maint-checkout-fix' into 'jc/better-conflict-resolution'
* jc/maint-checkout-fix: checkout --ours/--theirs: allow checking out one side of a conflicting merge checkout -f: allow ignoring unmerged paths when checking out of the index checkout: do not check out unmerged higher stages randomly
Diffstat (limited to 'Documentation/git-checkout.txt')
1 files changed, 20 insertions, 6 deletions
diff --git a/Documentation/git-checkout.txt b/Documentation/git-checkout.txt
index 5aa69c0..a9ca2f5 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' [<tree-ish>] [--] <paths>...
+'git checkout' [-f|--ours|--theirs] [<tree-ish>] [--] <paths>...
@@ -23,14 +23,19 @@ options, which will be passed to `git branch`.
When <paths> are given, this command does *not* switch
branches. It updates the named paths in the working tree from
-the index file (i.e. it runs `git checkout-index -f -u`), or
-from a named commit. In
-this case, the `-f` and `-b` options are meaningless and giving
+the index file, or from a named commit. In
+this case, the `-b` options is meaningless and giving
either of them results in an error. <tree-ish> argument can be
used to specify a specific tree-ish (i.e. commit, tag or tree)
to update the index for the given paths before updating the
working tree.
+The index may contain unmerged entries after a failed merge. By
+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.
@@ -38,8 +43,17 @@ OPTIONS
Quiet, suppress feedback messages.
- Proceed even if the index or the working tree differs
- from HEAD. This is used to throw away local changes.
+ When switching branches, proceed even if the index or the
+ working tree differs from HEAD. This is used to throw away
+ local changes.
+When checking out paths from the index, do not fail upon unmerged
+entries; instead, unmerged entries are ignored.
+ When checking out paths from the index, check out stage #2
+ ('ours') or #3 ('theirs') for unmerged paths.
Create a new branch named <new_branch> and start it at