From: Junio C Hamano Date: Fri, 09 Sep 2016 19:21:02 GMT Subject: Re: [PATCH 2/3] checkout.txt: document a common case that ignores ambiguation rules Message-ID: In-Reply-To: I'll queue the following as "fixup!" for now. It reminds me that the title also needs rewording; we do not have rules to make things ambiguous ;-) diff --git a/Documentation/git-checkout.txt b/Documentation/git-checkout.txt index 46b04b1..8e2c066 100644 --- a/Documentation/git-checkout.txt +++ b/Documentation/git-checkout.txt @@ -419,14 +419,17 @@ $ git reflog -2 HEAD # or $ git log -g -2 HEAD ------------ -ARGUMENT AMBIGUATION --------------------- +ARGUMENT DISAMBIGUATION +----------------------- When there is only one argument given and it is not `--` (e.g. "git -checkout abc"), "abc" could be seen as either a `` or a -``, but Git will assume the argument is a ``, which is -a common case for switching branches. Use `git checkout -- ` -form if you mean it to be a pathspec. +checkout abc"), and when the argument is both a valid `` +(e.g. a branch "abc" exists) and a valid `` (e.g. a file +or a directory whose name is "abc" exists), Git would usually ask +you to disambiguate. Because checking out a branch is so common an +operation, however, "git checkout abc" takes "abc" as a `` +in such a situation. Use `git checkout -- ` if you want +to checkout these paths out of the index. EXAMPLES -------- -- 2.10.0-339-gc0c747f