summaryrefslogtreecommitdiffstats
path: root/gitcli.html
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-10-31 13:25:53 -0700
committerJunio C Hamano <gitster@pobox.com>2014-10-31 13:25:53 -0700
commitc14e6ad9a230ad90c84b7f620d87fbe49a2d0342 (patch)
tree120346dc383e3d1c4219fe8c533eb22cb6af2b55 /gitcli.html
parent2a4bcbc355496c8d83b1b9f8892c4cbe8f584158 (diff)
downloadgit-htmldocs-c14e6ad9a230ad90c84b7f620d87fbe49a2d0342.tar.gz
Autogenerated HTML docs for v2.2.0-rc0
Diffstat (limited to 'gitcli.html')
-rw-r--r--gitcli.html138
1 files changed, 68 insertions, 70 deletions
diff --git a/gitcli.html b/gitcli.html
index 3ec9a1749..a787f0e77 100644
--- a/gitcli.html
+++ b/gitcli.html
@@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
-<meta name="generator" content="AsciiDoc 8.6.6" />
+<meta name="generator" content="AsciiDoc 8.6.9" />
<title>gitcli(7)</title>
<style type="text/css">
/* Shared CSS for AsciiDoc xhtml11 and html5 backends */
@@ -87,10 +87,16 @@ ul, ol, li > p {
ul > li { color: #aaa; }
ul > li > * { color: black; }
-pre {
+.monospaced, code, pre {
+ font-family: "Courier New", Courier, monospace;
+ font-size: inherit;
+ color: navy;
padding: 0;
margin: 0;
}
+pre {
+ white-space: pre-wrap;
+}
#author {
color: #527bbd;
@@ -219,7 +225,7 @@ div.exampleblock > div.content {
}
div.imageblock div.content { padding-left: 0; }
-span.image img { border-style: none; }
+span.image img { border-style: none; vertical-align: text-bottom; }
a.image:visited { color: white; }
dl {
@@ -349,7 +355,7 @@ div.colist td img {
margin-bottom: 0.1em;
}
-div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
+div.toclevel0, div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
margin-top: 0;
margin-bottom: 0;
}
@@ -407,18 +413,14 @@ span.underline { text-decoration: underline; }
span.overline { text-decoration: overline; }
span.line-through { text-decoration: line-through; }
+div.unbreakable { page-break-inside: avoid; }
+
/*
* xhtml11 specific
*
* */
-tt {
- font-family: monospace;
- font-size: inherit;
- color: navy;
-}
-
div.tableblock {
margin-top: 1.0em;
margin-bottom: 1.5em;
@@ -452,12 +454,6 @@ div.tableblock > table[frame="vsides"] {
*
* */
-.monospaced {
- font-family: monospace;
- font-size: inherit;
- color: navy;
-}
-
table.tableblock {
margin-top: 1.0em;
margin-bottom: 1.5em;
@@ -537,6 +533,8 @@ body.manpage div.sectionbody {
@media print {
body.manpage div#toc { display: none; }
}
+
+
</style>
<script type="text/javascript">
/*<![CDATA[*/
@@ -581,7 +579,7 @@ toc: function (toclevels) {
function tocEntries(el, toclevels) {
var result = new Array;
- var re = new RegExp('[hH]([2-'+(toclevels+1)+'])');
+ var re = new RegExp('[hH]([1-'+(toclevels+1)+'])');
// Function that scans the DOM tree for header elements (the DOM2
// nodeIterator API would be a better technique but not supported by all
// browsers).
@@ -610,7 +608,7 @@ toc: function (toclevels) {
var i;
for (i = 0; i < toc.childNodes.length; i++) {
var entry = toc.childNodes[i];
- if (entry.nodeName == 'div'
+ if (entry.nodeName.toLowerCase() == 'div'
&& entry.getAttribute("class")
&& entry.getAttribute("class").match(/^toclevel/))
tocEntriesToRemove.push(entry);
@@ -656,7 +654,7 @@ footnotes: function () {
var entriesToRemove = [];
for (i = 0; i < noteholder.childNodes.length; i++) {
var entry = noteholder.childNodes[i];
- if (entry.nodeName == 'div' && entry.getAttribute("class") == "footnote")
+ if (entry.nodeName.toLowerCase() == 'div' && entry.getAttribute("class") == "footnote")
entriesToRemove.push(entry);
}
for (i = 0; i < entriesToRemove.length; i++) {
@@ -763,33 +761,33 @@ arguments. Here are the rules:</p></div>
<li>
<p>
Revisions come first and then paths.
- E.g. in <tt>git diff v1.0 v2.0 arch/x86 include/asm-x86</tt>,
- <tt>v1.0</tt> and <tt>v2.0</tt> are revisions and <tt>arch/x86</tt> and <tt>include/asm-x86</tt>
+ E.g. in <code>git diff v1.0 v2.0 arch/x86 include/asm-x86</code>,
+ <code>v1.0</code> and <code>v2.0</code> are revisions and <code>arch/x86</code> and <code>include/asm-x86</code>
are paths.
</p>
</li>
<li>
<p>
When an argument can be misunderstood as either a revision or a path,
- they can be disambiguated by placing <tt>--</tt> between them.
- E.g. <tt>git diff -- HEAD</tt> is, "I have a file called HEAD in my work
+ they can be disambiguated by placing <code>--</code> between them.
+ E.g. <code>git diff -- HEAD</code> is, "I have a file called HEAD in my work
tree. Please show changes between the version I staged in the index
and what I have in the work tree for that file", not "show difference
between the HEAD commit and the work tree as a whole". You can say
- <tt>git diff HEAD --</tt> to ask for the latter.
+ <code>git diff HEAD --</code> to ask for the latter.
</p>
</li>
<li>
<p>
-Without disambiguating <tt>--</tt>, Git makes a reasonable guess, but errors
+Without disambiguating <code>--</code>, Git makes a reasonable guess, but errors
out and asking you to disambiguate when ambiguous. E.g. if you have a
- file called HEAD in your work tree, <tt>git diff HEAD</tt> is ambiguous, and
- you have to say either <tt>git diff HEAD --</tt> or <tt>git diff -- HEAD</tt> to
+ file called HEAD in your work tree, <code>git diff HEAD</code> is ambiguous, and
+ you have to say either <code>git diff HEAD --</code> or <code>git diff -- HEAD</code> to
disambiguate.
</p>
<div class="paragraph"><p>When writing a script that is expected to handle random user-input, it is
a good practice to make it explicit which arguments are which by placing
-disambiguating <tt>--</tt> at appropriate places.</p></div>
+disambiguating <code>--</code> at appropriate places.</p></div>
</li>
<li>
<p>
@@ -799,15 +797,15 @@ Many commands allow wildcards in paths, but you need to protect
</p>
<div class="listingblock">
<div class="content">
-<pre><tt>$ git checkout -- *.c
-$ git checkout -- \*.c</tt></pre>
+<pre><code>$ git checkout -- *.c
+$ git checkout -- \*.c</code></pre>
</div></div>
<div class="paragraph"><p>The former lets your shell expand the fileglob, and you are asking
the dot-C files in your working tree to be overwritten with the version
-in the index. The latter passes the <tt>*.c</tt> to Git, and you are asking
+in the index. The latter passes the <code>*.c</code> to Git, and you are asking
the paths in the index that match the pattern to be checked out to your
-working tree. After running <tt>git add hello.c; rm hello.c</tt>, you will <em>not</em>
-see <tt>hello.c</tt> in your working tree with the former, but with the latter
+working tree. After running <code>git add hello.c; rm hello.c</code>, you will <em>not</em>
+see <code>hello.c</code> in your working tree with the former, but with the latter
you will.</p></div>
</li>
<li>
@@ -824,20 +822,20 @@ scripting Git:</p></div>
<li>
<p>
it&#8217;s preferred to use the non-dashed form of Git commands, which means that
- you should prefer <tt>git foo</tt> to <tt>git-foo</tt>.
+ you should prefer <code>git foo</code> to <code>git-foo</code>.
</p>
</li>
<li>
<p>
-splitting short options to separate words (prefer <tt>git foo -a -b</tt>
- to <tt>git foo -ab</tt>, the latter may not even work).
+splitting short options to separate words (prefer <code>git foo -a -b</code>
+ to <code>git foo -ab</code>, the latter may not even work).
</p>
</li>
<li>
<p>
when a command-line option takes an argument, use the <em>stuck</em> form. In
- other words, write <tt>git foo -oArg</tt> instead of <tt>git foo -o Arg</tt> for short
- options, and <tt>git foo --long-opt=Arg</tt> instead of <tt>git foo --long-opt Arg</tt>
+ other words, write <code>git foo -oArg</code> instead of <code>git foo -o Arg</code> for short
+ options, and <code>git foo --long-opt=Arg</code> instead of <code>git foo --long-opt Arg</code>
for long options. An option that takes optional option-argument must be
written in the <em>stuck</em> form.
</p>
@@ -846,18 +844,18 @@ when a command-line option takes an argument, use the <em>stuck</em> form. In
<p>
when you give a revision parameter to a command, make sure the parameter is
not ambiguous with a name of a file in the work tree. E.g. do not write
- <tt>git log -1 HEAD</tt> but write <tt>git log -1 HEAD --</tt>; the former will not work
- if you happen to have a file called <tt>HEAD</tt> in the work tree.
+ <code>git log -1 HEAD</code> but write <code>git log -1 HEAD --</code>; the former will not work
+ if you happen to have a file called <code>HEAD</code> in the work tree.
</p>
</li>
<li>
<p>
-many commands allow a long option <tt>--option</tt> to be abbreviated
+many commands allow a long option <code>--option</code> to be abbreviated
only to their unique prefix (e.g. if there is no other option
- whose name begins with <tt>opt</tt>, you may be able to spell <tt>--opt</tt> to
- invoke the <tt>--option</tt> flag), but you should fully spell them out
+ whose name begins with <code>opt</code>, you may be able to spell <code>--opt</code> to
+ invoke the <code>--option</code> flag), but you should fully spell them out
when writing your scripts; later versions of Git may introduce a
- new option whose name shares the same prefix, e.g. <tt>--optimize</tt>,
+ new option whose name shares the same prefix, e.g. <code>--optimize</code>,
to make a short prefix that used to be unique no longer unique.
</p>
</li>
@@ -884,7 +882,7 @@ couple of magic command-line options:</p></div>
</p>
<div class="listingblock">
<div class="content">
-<pre><tt>$ git describe -h
+<pre><code>$ git describe -h
usage: git describe [options] &lt;commit-ish&gt;*
or: git describe [options] --dirty
@@ -893,7 +891,7 @@ usage: git describe [options] &lt;commit-ish&gt;*
--all use any ref
--tags use any tag, even unannotated
--long always use long format
- --abbrev[=&lt;n&gt;] use &lt;n&gt; digits to display SHA-1s</tt></pre>
+ --abbrev[=&lt;n&gt;] use &lt;n&gt; digits to display SHA-1s</code></pre>
</div></div>
</dd>
<dt class="hdlist1">
@@ -910,25 +908,25 @@ usage: git describe [options] &lt;commit-ish&gt;*
</div>
<div class="sect2">
<h3 id="_negating_options">Negating options</h3>
-<div class="paragraph"><p>Options with long option names can be negated by prefixing <tt>--no-</tt>. For
-example, <tt>git branch</tt> has the option <tt>--track</tt> which is <em>on</em> by default. You
-can use <tt>--no-track</tt> to override that behaviour. The same goes for <tt>--color</tt>
-and <tt>--no-color</tt>.</p></div>
+<div class="paragraph"><p>Options with long option names can be negated by prefixing <code>--no-</code>. For
+example, <code>git branch</code> has the option <code>--track</code> which is <em>on</em> by default. You
+can use <code>--no-track</code> to override that behaviour. The same goes for <code>--color</code>
+and <code>--no-color</code>.</p></div>
</div>
<div class="sect2">
<h3 id="_aggregating_short_options">Aggregating short options</h3>
<div class="paragraph"><p>Commands that support the enhanced option parser allow you to aggregate short
-options. This means that you can for example use <tt>git rm -rf</tt> or
-<tt>git clean -fdx</tt>.</p></div>
+options. This means that you can for example use <code>git rm -rf</code> or
+<code>git clean -fdx</code>.</p></div>
</div>
<div class="sect2">
<h3 id="_abbreviating_long_options">Abbreviating long options</h3>
<div class="paragraph"><p>Commands that support the enhanced option parser accepts unique
prefix of a long option as if it is fully spelled out, but use this
-with a caution. For example, <tt>git commit --amen</tt> behaves as if you
-typed <tt>git commit --amend</tt>, but that is true only until a later version
+with a caution. For example, <code>git commit --amen</code> behaves as if you
+typed <code>git commit --amend</code>, but that is true only until a later version
of Git introduces another option that shares the same prefix,
-e.g. <tt>git commit --amenity</tt> option.</p></div>
+e.g. <code>git commit --amenity</code> option.</p></div>
</div>
<div class="sect2">
<h3 id="_separating_argument_from_the_option">Separating argument from the option</h3>
@@ -936,18 +934,18 @@ e.g. <tt>git commit --amenity</tt> option.</p></div>
word on the command line. That means that all the following uses work:</p></div>
<div class="listingblock">
<div class="content">
-<pre><tt>$ git foo --long-opt=Arg
+<pre><code>$ git foo --long-opt=Arg
$ git foo --long-opt Arg
$ git foo -oArg
-$ git foo -o Arg</tt></pre>
+$ git foo -o Arg</code></pre>
</div></div>
<div class="paragraph"><p>However, this is <strong>NOT</strong> allowed for switches with an optional value, where the
<em>stuck</em> form must be used:</p></div>
<div class="listingblock">
<div class="content">
-<pre><tt>$ git describe --abbrev HEAD # correct
+<pre><code>$ git describe --abbrev HEAD # correct
$ git describe --abbrev=10 HEAD # correct
-$ git describe --abbrev 10 HEAD # NOT WHAT YOU MEANT</tt></pre>
+$ git describe --abbrev 10 HEAD # NOT WHAT YOU MEANT</code></pre>
</div></div>
</div>
</div>
@@ -956,7 +954,7 @@ $ git describe --abbrev 10 HEAD # NOT WHAT YOU MEANT</tt></pre>
<h2 id="_notes_on_frequently_confused_options">NOTES ON FREQUENTLY CONFUSED OPTIONS</h2>
<div class="sectionbody">
<div class="paragraph"><p>Many commands that can work on files in the working tree
-and/or in the index can take <tt>--cached</tt> and/or <tt>--index</tt>
+and/or in the index can take <code>--cached</code> and/or <code>--index</code>
options. Sometimes people incorrectly think that, because
the index was originally called cache, these two are
synonyms. They are <strong>not</strong>&#8201;&#8212;&#8201;these two options mean very
@@ -964,31 +962,31 @@ different things.</p></div>
<div class="ulist"><ul>
<li>
<p>
-The <tt>--cached</tt> option is used to ask a command that
+The <code>--cached</code> option is used to ask a command that
usually works on files in the working tree to <strong>only</strong> work
- with the index. For example, <tt>git grep</tt>, when used
+ with the index. For example, <code>git grep</code>, when used
without a commit to specify from which commit to look for
strings in, usually works on files in the working tree,
- but with the <tt>--cached</tt> option, it looks for strings in
+ but with the <code>--cached</code> option, it looks for strings in
the index.
</p>
</li>
<li>
<p>
-The <tt>--index</tt> option is used to ask a command that
+The <code>--index</code> option is used to ask a command that
usually works on files in the working tree to <strong>also</strong>
- affect the index. For example, <tt>git stash apply</tt> usually
+ affect the index. For example, <code>git stash apply</code> usually
merges changes recorded in a stash to the working tree,
- but with the <tt>--index</tt> option, it also merges changes to
+ but with the <code>--index</code> option, it also merges changes to
the index as well.
</p>
</li>
</ul></div>
-<div class="paragraph"><p><tt>git apply</tt> command can be used with <tt>--cached</tt> and
-<tt>--index</tt> (but not at the same time). Usually the command
+<div class="paragraph"><p><code>git apply</code> command can be used with <code>--cached</code> and
+<code>--index</code> (but not at the same time). Usually the command
only affects the files in the working tree, but with
-<tt>--index</tt>, it patches both the files and their index
-entries, and with <tt>--cached</tt>, it modifies only the index
+<code>--index</code>, it patches both the files and their index
+entries, and with <code>--cached</code>, it modifies only the index
entries.</p></div>
<div class="paragraph"><p>See also <a href="http://marc.info/?l=git&amp;m=116563135620359">http://marc.info/?l=git&amp;m=116563135620359</a> and
<a href="http://marc.info/?l=git&amp;m=119150393620273">http://marc.info/?l=git&amp;m=119150393620273</a> for further