summaryrefslogtreecommitdiffstats
path: root/git-checkout.txt
diff options
context:
space:
mode:
authorJunio C Hamano <junio@hera.kernel.org>2009-04-18 06:17:56 +0000
committerJunio C Hamano <junio@hera.kernel.org>2009-04-18 06:17:56 +0000
commit3bd66e9adf9669a8ba7bf8f191a111ae0cf41e51 (patch)
treeb0bda7514cbe49768ca02dee664f52a85399c2dd /git-checkout.txt
parent98e32c30fcbbbed199fa402656feffe7f4843784 (diff)
downloadgit-htmldocs-3bd66e9adf9669a8ba7bf8f191a111ae0cf41e51.tar.gz
Autogenerated HTML docs for v1.6.3-rc0-53-g1a1f0
Diffstat (limited to 'git-checkout.txt')
-rw-r--r--git-checkout.txt67
1 files changed, 31 insertions, 36 deletions
diff --git a/git-checkout.txt b/git-checkout.txt
index 223ea9cae..ad4b31e89 100644
--- a/git-checkout.txt
+++ b/git-checkout.txt
@@ -8,22 +8,22 @@ git-checkout - Checkout a branch or paths to the working tree
SYNOPSIS
--------
[verse]
-'git checkout' [-q] [-f] [-t | --track | --no-track] [-b <new_branch> [-l]] [-m] [<branch>]
+'git checkout' [-q] [-f] [-m] [<branch>]
+'git checkout' [-q] [-f] [-m] [-b <new_branch>] [<start_point>]
'git checkout' [-f|--ours|--theirs|-m|--conflict=<style>] [<tree-ish>] [--] <paths>...
DESCRIPTION
-----------
When <paths> are not given, this command switches branches by
-updating the index and working tree to reflect the specified
-branch, <branch>, and updating HEAD to be <branch> or, if
-specified, <new_branch>. Using -b will cause <new_branch> to
-be created; in this case you can use the --track or --no-track
-options, which will be passed to `git branch`.
+updating the index, working tree, and HEAD to reflect the specified
+branch.
-As a convenience, --track will default to creating a branch whose
-name is constructed from the specified branch name by stripping
-the first namespace level.
+If `-b` is given, a new branch is created and checked out, as if
+linkgit:git-branch[1] were called; in this case you can
+use the --track or --no-track options, which will be passed to `git
+branch`. As a convenience, --track without `-b` implies branch
+creation; see the description of --track below.
When <paths> are given, this command does *not* switch
branches. It updates the named paths in the working tree from
@@ -62,22 +62,12 @@ entries; instead, unmerged entries are ignored.
-b::
Create a new branch named <new_branch> and start it at
- <branch>. The new branch name must pass all checks defined
- by linkgit:git-check-ref-format[1]. Some of these checks
- may restrict the characters allowed in a branch name.
+ <start_point>; see linkgit:git-branch[1] for details.
-t::
--track::
- When creating a new branch, set up configuration so that 'git-pull'
- will automatically retrieve data from the start point, which must be
- a branch. Use this if you always pull from the same upstream branch
- into the new branch, and if you don't want to use "git pull
- <repository> <refspec>" explicitly. This behavior is the default
- when the start point is a remote branch. Set the
- branch.autosetupmerge configuration variable to `false` if you want
- 'git checkout' and 'git branch' to always behave as if '--no-track' were
- given. Set it to `always` if you want this behavior when the
- start point is either a local or remote branch.
+ When creating a new branch, set up "upstream" configuration. See
+ "--track" in linkgit:git-branch[1] for details.
+
If no '-b' option is given, the name of the new branch will be
derived from the remote branch. If "remotes/" or "refs/remotes/"
@@ -90,12 +80,12 @@ guessing results in an empty name, the guessing is aborted. You can
explicitly give a name with '-b' in such a case.
--no-track::
- Ignore the branch.autosetupmerge configuration variable.
+ Do not set up "upstream" configuration, even if the
+ branch.autosetupmerge configuration variable is true.
-l::
- Create the new branch's reflog. This activates recording of
- all changes made to the branch ref, enabling use of date
- based sha1 expressions such as "<branchname>@\{yesterday}".
+ Create the new branch's reflog; see linkgit:git-branch[1] for
+ details.
-m::
--merge::
@@ -123,23 +113,28 @@ the conflicted merge in the specified paths.
"merge" (default) and "diff3" (in addition to what is shown by
"merge" style, shows the original contents).
+<branch>::
+ 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
+`-` which is synonymous with `"@\{-1\}"`.
+
<new_branch>::
Name for the new branch.
+<start_point>::
+ The name of a commit at which to start the new branch; see
+ linkgit:git-branch[1] for details. Defaults to HEAD.
+
<tree-ish>::
Tree to checkout from (when paths are given). If not specified,
the index will be used.
-<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'.
-+
-As a special case, the `"@\{-N\}"` syntax for the N-th last branch
-checks out the branch (instead of detaching). You may also specify
-`-` which is synonymous with `"@\{-1\}"`.
Detached HEAD