summaryrefslogtreecommitdiffstats
path: root/git-checkout.txt
diff options
context:
space:
mode:
authorJunio C Hamano <junio@kernel.org>2010-08-18 22:15:35 +0000
committerJunio C Hamano <junio@kernel.org>2010-08-18 22:15:35 +0000
commit619596afe5769620cfbaca941f701a3fa106e6e5 (patch)
treea0065a9102205adf638a7ff9e35bb50ce049dcd0 /git-checkout.txt
parentb5a296fa6d8cd1a703ce2eb6232e0bbc654bd2a2 (diff)
downloadgit-htmldocs-619596afe5769620cfbaca941f701a3fa106e6e5.tar.gz
Autogenerated HTML docs for v1.7.2.1-158-gbd3a97
Diffstat (limited to 'git-checkout.txt')
-rw-r--r--git-checkout.txt21
1 files changed, 19 insertions, 2 deletions
diff --git a/git-checkout.txt b/git-checkout.txt
index 1bacd2e10..66e570113 100644
--- a/git-checkout.txt
+++ b/git-checkout.txt
@@ -9,7 +9,7 @@ SYNOPSIS
--------
[verse]
'git checkout' [-q] [-f] [-m] [<branch>]
-'git checkout' [-q] [-f] [-m] [[-b|--orphan] <new_branch>] [<start_point>]
+'git checkout' [-q] [-f] [-m] [[-b|-B|--orphan] <new_branch>] [<start_point>]
'git checkout' [-f|--ours|--theirs|-m|--conflict=<style>] [<tree-ish>] [--] <paths>...
'git checkout' --patch [<tree-ish>] [--] [<paths>...]
@@ -21,7 +21,7 @@ also update `HEAD` to set the specified branch as the current
branch.
'git checkout' [<branch>]::
-'git checkout' -b <new branch> [<start point>]::
+'git checkout' -b|-B <new_branch> [<start point>]::
This form switches branches by updating the index, working
tree, and HEAD to reflect the specified branch.
@@ -31,6 +31,17 @@ were called and then checked out; 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.
++
+If `-B` is given, <new_branch> is created if it doesn't exist; otherwise, it
+is reset. This is the transactional equivalent of
++
+------------
+$ git branch -f <branch> [<start point>]
+$ git checkout <branch>
+------------
++
+that is to say, the branch is not reset/created unless "git checkout" is
+successful.
'git checkout' [--patch] [<tree-ish>] [--] <pathspec>...::
@@ -75,6 +86,12 @@ entries; instead, unmerged entries are ignored.
Create a new branch named <new_branch> and start it at
<start_point>; see linkgit:git-branch[1] for details.
+-B::
+ Creates the branch <new_branch> and start it at <start_point>;
+ if it already exists, then reset it to <start_point>. This is
+ equivalent to running "git branch" with "-f"; see
+ linkgit:git-branch[1] for details.
+
-t::
--track::
When creating a new branch, set up "upstream" configuration. See