Browse Source

docs/checkout: clarify what "non-branch" means

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>
maint
Jeff King 16 years ago committed by Junio C Hamano
parent
commit
0808723b50
  1. 10
      Documentation/git-checkout.txt

10
Documentation/git-checkout.txt

@ -114,11 +114,11 @@ the conflicted merge in the specified paths.
"merge" style, shows the original contents). "merge" style, shows the original contents).


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

Loading…
Cancel
Save