summaryrefslogtreecommitdiff
path: root/Documentation
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-08-20 04:43:04 (GMT)
committerJunio C Hamano <gitster@pobox.com>2008-08-20 04:43:04 (GMT)
commit614eef259f0e805c7f656e1684b6a7ae56e1ee40 (patch)
tree6941085fb597d6fcf04897c9cc3c5ddaab2cf80a /Documentation
parent652b0bbe09c909eb5aa34be8746071f1c5c0e73d (diff)
parentbb0ceb6264fa1aea6e68e07cb13cd9a88473febb (diff)
downloadgit-614eef259f0e805c7f656e1684b6a7ae56e1ee40.zip
git-614eef259f0e805c7f656e1684b6a7ae56e1ee40.tar.gz
git-614eef259f0e805c7f656e1684b6a7ae56e1ee40.tar.bz2
Merge branch 'js/checkout-dwim-local'
* js/checkout-dwim-local: checkout --track: make up a sensible branch name if '-b' was omitted
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/git-checkout.txt10
1 files changed, 9 insertions, 1 deletions
diff --git a/Documentation/git-checkout.txt b/Documentation/git-checkout.txt
index 5aa69c0..43d4502 100644
--- a/Documentation/git-checkout.txt
+++ b/Documentation/git-checkout.txt
@@ -8,7 +8,7 @@ git-checkout - Checkout a branch or paths to the working tree
SYNOPSIS
--------
[verse]
-'git checkout' [-q] [-f] [[--track | --no-track] -b <new_branch> [-l]] [-m] [<branch>]
+'git checkout' [-q] [-f] [--track | --no-track] [-b <new_branch> [-l]] [-m] [<branch>]
'git checkout' [<tree-ish>] [--] <paths>...
DESCRIPTION
@@ -21,6 +21,10 @@ 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`.
+As a convenience, --track will default to create a branch whose
+name is constructed from the specified branch name by stripping
+the first namespace level.
+
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
@@ -59,6 +63,10 @@ OPTIONS
'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.
++
+If no '-b' option was given, a name will be made up for you, by stripping
+the part up to the first slash of the tracked branch. For example, if you
+called 'git checkout --track origin/next', the branch name will be 'next'.
--no-track::
Ignore the branch.autosetupmerge configuration variable.