summaryrefslogtreecommitdiff
path: root/Documentation/git-checkout.txt
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-08-30 14:46:55 (GMT)
committerJunio C Hamano <gitster@pobox.com>2008-08-31 02:16:12 (GMT)
commitdb9410990ee41f2b253763621c0023c782ec86e2 (patch)
tree59a1b964e8437f0a06e9a4f2bbcb638849f18e2b /Documentation/git-checkout.txt
parent8fdcf3125465f70c0cad5be5ab192d46e46307c7 (diff)
downloadgit-db9410990ee41f2b253763621c0023c782ec86e2.zip
git-db9410990ee41f2b253763621c0023c782ec86e2.tar.gz
git-db9410990ee41f2b253763621c0023c782ec86e2.tar.bz2
checkout -f: allow ignoring unmerged paths when checking out of the index
Earlier we made "git checkout $pathspec" to atomically refuse the operation of $pathspec matched any path with unmerged stages. This patch allows: $ git checkout -f a b c to ignore, instead of error out on, such unmerged paths. The fix to prevent checkout of an unmerged path from random stages is still there. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/git-checkout.txt')
-rw-r--r--Documentation/git-checkout.txt19
1 files changed, 13 insertions, 6 deletions
diff --git a/Documentation/git-checkout.txt b/Documentation/git-checkout.txt
index 5aa69c0..15fdb08 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' [<tree-ish>] [--] <paths>...
+'git checkout' [-f] [<tree-ish>] [--] <paths>...
DESCRIPTION
-----------
@@ -23,14 +23,17 @@ 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.
OPTIONS
-------
@@ -38,8 +41,12 @@ OPTIONS
Quiet, suppress feedback messages.
-f::
- 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.
-b::
Create a new branch named <new_branch> and start it at