Skip to content

Commit

Permalink
docs/checkout: clarify what "non-branch" means
Browse files Browse the repository at this point in the history
In the code we literally stick "refs/heads/" on the front
and see if it resolves, so that is probably the best
explanation.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Jeff King authored and Junio C Hamano committed Apr 13, 2009
1 parent 76cfadf commit 0808723
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Documentation/git-checkout.txt
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,11 @@ the conflicted merge in the specified paths.
"merge" style, shows the original contents).

<branch>::
Branch to checkout (when no paths are given); may be any object
ID that resolves to a commit. Defaults to HEAD.
+
When this parameter names a non-branch (but still a valid commit object),
your HEAD becomes 'detached'.
Branch to checkout; if it refers to a branch (i.e., a name that,
when prepended with "refs/heads/", is a valid ref), then that
branch is checked out. Otherwise, if it refers to a valid
commit, your HEAD becomes "detached" and you are no longer on
any branch (see below for details).
+
As a special case, the `"@\{-N\}"` syntax for the N-th last branch
checks out the branch (instead of detaching). You may also specify
Expand Down

0 comments on commit 0808723

Please sign in to comment.