diff options
author | Junio C Hamano <gitster@pobox.com> | 2012-12-21 15:49:12 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-12-21 15:49:12 -0800 |
commit | db81b99382f90c930f2d2a737b4fdf2b7d63a00b (patch) | |
tree | 2f0174096812fd2f2d403afbf13add15952cfa36 /git-checkout.html | |
parent | 9d9711544dc3090db6e5c52f9ce9c300bf4f5c14 (diff) | |
download | git-htmldocs-db81b99382f90c930f2d2a737b4fdf2b7d63a00b.tar.gz |
Autogenerated HTML docs for v1.8.1-rc2-38-gb10c4
Diffstat (limited to 'git-checkout.html')
-rw-r--r-- | git-checkout.html | 60 |
1 files changed, 48 insertions, 12 deletions
diff --git a/git-checkout.html b/git-checkout.html index e4c8fdde3..d424a2a5f 100644 --- a/git-checkout.html +++ b/git-checkout.html @@ -764,24 +764,40 @@ also update <code>HEAD</code> to set the specified branch as the current branch.</p></div>
<div class="dlist"><dl>
<dt class="hdlist1">
-<em>git checkout</em> [<branch>]
+<em>git checkout</em> <branch>
</dt>
+<dd>
+<p>
+ To prepare for working on <branch>, switch to it by updating
+ the index and the files in the working tree, and by pointing
+ HEAD at the branch. Local modifications to the files in the
+ working tree are kept, so that they can be committed to the
+ <branch>.
+</p>
+<div class="paragraph"><p>If <branch> is not found but there does exist a tracking branch in
+exactly one remote (call it <remote>) with a matching name, treat as
+equivalent to</p></div>
+<div class="listingblock">
+<div class="content">
+<pre><code>$ git checkout -b <branch> --track <remote>/<branch></code></pre>
+</div></div>
+<div class="paragraph"><p>You could omit <branch>, in which case the command degenerates to
+"check out the current branch", which is a glorified no-op with a
+rather expensive side-effects to show only the tracking information,
+if exists, for the current branch.</p></div>
+</dd>
<dt class="hdlist1">
<em>git checkout</em> -b|-B <new_branch> [<start point>]
</dt>
-<dt class="hdlist1">
-<em>git checkout</em> [--detach] [<commit>]
-</dt>
<dd>
<p>
- This form switches branches by updating the index, working
- tree, and HEAD to reflect the specified branch or commit.
+ Specifying <code>-b</code> causes a new branch to be created as if
+ <a href="git-branch.html">git-branch(1)</a> were called and then checked out. In
+ this case you can use the <code>--track</code> or <code>--no-track</code> options,
+ which will be passed to <em>git branch</em>. As a convenience,
+ <code>--track</code> without <code>-b</code> implies branch creation; see the
+ description of <code>--track</code> below.
</p>
-<div class="paragraph"><p>If <code>-b</code> is given, a new branch is created as if <a href="git-branch.html">git-branch(1)</a>
-were called and then checked out; in this case you can
-use the <code>--track</code> or <code>--no-track</code> options, which will be passed to
-<em>git branch</em>. As a convenience, <code>--track</code> without <code>-b</code> implies branch
-creation; see the description of <code>--track</code> below.</p></div>
<div class="paragraph"><p>If <code>-B</code> is given, <new_branch> is created if it doesn’t exist; otherwise, it
is reset. This is the transactional equivalent of</p></div>
<div class="listingblock">
@@ -793,6 +809,26 @@ $ git checkout <branch></code></pre> successful.</p></div>
</dd>
<dt class="hdlist1">
+<em>git checkout</em> --detach [<branch>]
+</dt>
+<dt class="hdlist1">
+<em>git checkout</em> <commit>
+</dt>
+<dd>
+<p>
+ Prepare to work on top of <commit>, by detaching HEAD at it
+ (see "DETACHED HEAD" section), and updating the index and the
+ files in the working tree. Local modifications to the files
+ in the working tree are kept, so that the resulting working
+ tree will be the state recorded in the commit plus the local
+ modifications.
+</p>
+<div class="paragraph"><p>Passing <code>--detach</code> forces this behavior in the case of a <branch> (without
+the option, giving a branch name to the command would check out the branch,
+instead of detaching HEAD at it), or the current commit,
+if no <branch> is specified.</p></div>
+</dd>
+<dt class="hdlist1">
<em>git checkout</em> [-p|--patch] [<tree-ish>] [--] <pathspec>…
</dt>
<dd>
@@ -1313,7 +1349,7 @@ $ git add frotz</code></pre> <div id="footnotes"><hr /></div>
<div id="footer">
<div id="footer-text">
-Last updated 2012-09-12 15:56:23 PDT
+Last updated 2012-12-21 15:43:33 PST
</div>
</div>
</body>
|