summaryrefslogtreecommitdiffstats
path: root/git-fetch.html
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-01-17 14:46:49 -0800
committerJunio C Hamano <gitster@pobox.com>2014-01-17 14:46:49 -0800
commit61525f915b47e953b4288a9afcee45e47b352214 (patch)
treef0649f89cc7a77c0296305f4673fc2bc7e0a6d54 /git-fetch.html
parentbc8d4783cac3c942fc9e8cf2f3eae4aea8cab5cb (diff)
downloadgit-htmldocs-61525f915b47e953b4288a9afcee45e47b352214.tar.gz
Autogenerated HTML docs for v1.9-rc0
Diffstat (limited to 'git-fetch.html')
-rw-r--r--git-fetch.html176
1 files changed, 97 insertions, 79 deletions
diff --git a/git-fetch.html b/git-fetch.html
index 144d1dea6..bce34f187 100644
--- a/git-fetch.html
+++ b/git-fetch.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.8" />
+<meta name="generator" content="AsciiDoc 8.6.6" />
<title>git-fetch(1)</title>
<style type="text/css">
/* Shared CSS for AsciiDoc xhtml11 and html5 backends */
@@ -87,15 +87,11 @@ ul, ol, li > p {
ul > li { color: #aaa; }
ul > li > * { color: black; }
-.monospaced, code, pre {
- font-family: "Courier New", Courier, monospace;
- font-size: inherit;
- color: navy;
+pre {
padding: 0;
margin: 0;
}
-
#author {
color: #527bbd;
font-weight: bold;
@@ -353,7 +349,7 @@ div.colist td img {
margin-bottom: 0.1em;
}
-div.toclevel0, div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
+div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
margin-top: 0;
margin-bottom: 0;
}
@@ -411,14 +407,18 @@ 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,6 +452,12 @@ div.tableblock > table[frame="vsides"] {
*
* */
+.monospaced {
+ font-family: monospace;
+ font-size: inherit;
+ color: navy;
+}
+
table.tableblock {
margin-top: 1.0em;
margin-bottom: 1.5em;
@@ -531,8 +537,6 @@ body.manpage div.sectionbody {
@media print {
body.manpage div#toc { display: none; }
}
-
-
</style>
<script type="text/javascript">
/*<![CDATA[*/
@@ -577,7 +581,7 @@ toc: function (toclevels) {
function tocEntries(el, toclevels) {
var result = new Array;
- var re = new RegExp('[hH]([1-'+(toclevels+1)+'])');
+ var re = new RegExp('[hH]([2-'+(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).
@@ -606,7 +610,7 @@ toc: function (toclevels) {
var i;
for (i = 0; i < toc.childNodes.length; i++) {
var entry = toc.childNodes[i];
- if (entry.nodeName.toLowerCase() == 'div'
+ if (entry.nodeName == 'div'
&& entry.getAttribute("class")
&& entry.getAttribute("class").match(/^toclevel/))
tocEntriesToRemove.push(entry);
@@ -652,7 +656,7 @@ footnotes: function () {
var entriesToRemove = [];
for (i = 0; i < noteholder.childNodes.length; i++) {
var entry = noteholder.childNodes[i];
- if (entry.nodeName.toLowerCase() == 'div' && entry.getAttribute("class") == "footnote")
+ if (entry.nodeName == 'div' && entry.getAttribute("class") == "footnote")
entriesToRemove.push(entry);
}
for (i = 0; i < entriesToRemove.length; i++) {
@@ -760,7 +764,7 @@ git-fetch(1) Manual Page
<div class="paragraph"><p>Fetches named heads or tags from one or more other repositories,
along with the objects necessary to complete them.</p></div>
<div class="paragraph"><p>The ref names and their object names of fetched refs are stored
-in <code>.git/FETCH_HEAD</code>. This information is left for a later merge
+in <tt>.git/FETCH_HEAD</tt>. This information is left for a later merge
operation done by <em>git merge</em>.</p></div>
<div class="paragraph"><p>By default, tags are auto-followed. This means that when fetching
from a remote, any tags on the remote that point to objects that exist
@@ -773,7 +777,7 @@ tags explicitly.</p></div>
or from several repositories at once if &lt;group&gt; is given and
there is a remotes.&lt;group&gt; entry in the configuration file.
(See <a href="git-config.html">git-config(1)</a>).</p></div>
-<div class="paragraph"><p>When no remote is specified, by default the <code>origin</code> remote will be used,
+<div class="paragraph"><p>When no remote is specified, by default the <tt>origin</tt> remote will be used,
unless there&#8217;s an upstream branch configured for the current branch.</p></div>
</div>
</div>
@@ -798,8 +802,8 @@ unless there&#8217;s an upstream branch configured for the current branch.</p></
<dd>
<p>
Append ref names and object names of fetched refs to the
- existing contents of <code>.git/FETCH_HEAD</code>. Without this
- option old data in <code>.git/FETCH_HEAD</code> will be overwritten.
+ existing contents of <tt>.git/FETCH_HEAD</tt>. Without this
+ option old data in <tt>.git/FETCH_HEAD</tt> will be overwritten.
</p>
</dd>
<dt class="hdlist1">
@@ -808,7 +812,7 @@ unless there&#8217;s an upstream branch configured for the current branch.</p></
<dd>
<p>
Deepen or shorten the history of a <em>shallow</em> repository created by
- <code>git clone</code> with <code>--depth=&lt;depth&gt;</code> option (see <a href="git-clone.html">git-clone(1)</a>)
+ <tt>git clone</tt> with <tt>--depth=&lt;depth&gt;</tt> option (see <a href="git-clone.html">git-clone(1)</a>)
to the specified number of commits from the tip of each remote
branch history. Tags for the deepened commits are not fetched.
</p>
@@ -818,8 +822,22 @@ unless there&#8217;s an upstream branch configured for the current branch.</p></
</dt>
<dd>
<p>
- Convert a shallow repository to a complete one, removing all
- the limitations imposed by shallow repositories.
+ If the source repository is complete, convert a shallow
+ repository to a complete one, removing all the limitations
+ imposed by shallow repositories.
+</p>
+<div class="paragraph"><p>If the source repository is shallow, fetch as much as possible so that
+the current repository has the same history as the source repository.</p></div>
+</dd>
+<dt class="hdlist1">
+--update-shallow
+</dt>
+<dd>
+<p>
+ By default when fetching from a shallow repository,
+ <tt>git fetch</tt> refuses refs that require updating
+ .git/shallow. This option updates .git/shallow and accept such
+ refs.
</p>
</dd>
<dt class="hdlist1">
@@ -838,10 +856,10 @@ unless there&#8217;s an upstream branch configured for the current branch.</p></
</dt>
<dd>
<p>
- When <em>git fetch</em> is used with <code>&lt;rbranch&gt;:&lt;lbranch&gt;</code>
+ When <em>git fetch</em> is used with <tt>&lt;rbranch&gt;:&lt;lbranch&gt;</tt>
refspec, it refuses to update the local branch
- <code>&lt;lbranch&gt;</code> unless the remote branch <code>&lt;rbranch&gt;</code> it
- fetches is a descendant of <code>&lt;lbranch&gt;</code>. This option
+ <tt>&lt;lbranch&gt;</tt> unless the remote branch <tt>&lt;rbranch&gt;</tt> it
+ fetches is a descendant of <tt>&lt;lbranch&gt;</tt>. This option
overrides that check.
</p>
</dd>
@@ -907,7 +925,7 @@ unless there&#8217;s an upstream branch configured for the current branch.</p></
<dd>
<p>
Fetch all tags from the remote (i.e., fetch remote tags
- <code>refs/tags/*</code> into local tags with the same name), in addition
+ <tt>refs/tags/*</tt> into local tags with the same name), in addition
to whatever else would otherwise be fetched. Using this
option alone does not subject tags to pruning, even if --prune
is used (though tags may be pruned anyway if they are also the
@@ -1051,13 +1069,13 @@ unless there&#8217;s an upstream branch configured for the current branch.</p></
<dd>
<p>
The format of a &lt;refspec&gt; parameter is an optional plus
- <code>+</code>, followed by the source ref &lt;src&gt;, followed
- by a colon <code>:</code>, followed by the destination ref &lt;dst&gt;.
+ <tt>+</tt>, followed by the source ref &lt;src&gt;, followed
+ by a colon <tt>:</tt>, followed by the destination ref &lt;dst&gt;.
</p>
<div class="paragraph"><p>The remote ref that matches &lt;src&gt;
is fetched, and if &lt;dst&gt; is not empty string, the local
ref that matches it is fast-forwarded using &lt;src&gt;.
-If the optional plus <code>+</code> is used, the local ref
+If the optional plus <tt>+</tt> is used, the local ref
is updated even if it does not result in a fast-forward
update.</p></div>
<div class="admonitionblock">
@@ -1070,7 +1088,7 @@ modified in non-linear ways such as being rewound and
rebased frequently, then a pull will attempt a merge with
an older version of itself, likely conflict, and fail.
It is under these conditions that you would want to use
-the <code>+</code> sign to indicate non-fast-forward updates will
+the <tt>+</tt> sign to indicate non-fast-forward updates will
be needed. There is currently no easy way to determine
or declare that a branch will be made available in a
repository with this behavior; the pulling user simply
@@ -1083,16 +1101,16 @@ must know this is the expected usage pattern for a branch.</td>
<div class="title">Note</div>
</td>
<td class="content">You never do your own development on branches that appear
-on the right hand side of a &lt;refspec&gt; colon on <code>Pull:</code> lines;
+on the right hand side of a &lt;refspec&gt; colon on <tt>Pull:</tt> lines;
they are to be updated by <em>git fetch</em>. If you intend to do
-development derived from a remote branch <code>B</code>, have a <code>Pull:</code>
-line to track it (i.e. <code>Pull: B:remote-B</code>), and have a separate
-branch <code>my-B</code> to do your development on top of it. The latter
-is created by <code>git branch my-B remote-B</code> (or its equivalent <code>git
-checkout -b my-B remote-B</code>). Run <code>git fetch</code> to keep track of
+development derived from a remote branch <tt>B</tt>, have a <tt>Pull:</tt>
+line to track it (i.e. <tt>Pull: B:remote-B</tt>), and have a separate
+branch <tt>my-B</tt> to do your development on top of it. The latter
+is created by <tt>git branch my-B remote-B</tt> (or its equivalent <tt>git
+checkout -b my-B remote-B</tt>). Run <tt>git fetch</tt> to keep track of
the progress of the remote side, and when you see something new
on the remote branch, merge it into your development branch with
-<code>git pull . remote-B</code>, while you are on <code>my-B</code> branch.</td>
+<tt>git pull . remote-B</tt>, while you are on <tt>my-B</tt> branch.</td>
</tr></table>
</div>
<div class="admonitionblock">
@@ -1102,13 +1120,13 @@ on the remote branch, merge it into your development branch with
</td>
<td class="content">There is a difference between listing multiple &lt;refspec&gt;
directly on <em>git pull</em> command line and having multiple
-<code>Pull:</code> &lt;refspec&gt; lines for a &lt;repository&gt; and running
+<tt>Pull:</tt> &lt;refspec&gt; lines for a &lt;repository&gt; and running
<em>git pull</em> command without any explicit &lt;refspec&gt; parameters.
&lt;refspec&gt; listed explicitly on the command line are always
merged into the current branch after fetching. In other words,
if you list more than one remote refs, you would be making
an Octopus. While <em>git pull</em> run without any explicit &lt;refspec&gt;
-parameter takes default &lt;refspec&gt;s from <code>Pull:</code> lines, it
+parameter takes default &lt;refspec&gt;s from <tt>Pull:</tt> lines, it
merges only the first &lt;refspec&gt; found into the current branch,
after fetching all the remote refs. This is because making an
Octopus from remote refs is rarely done, while keeping track
@@ -1120,7 +1138,7 @@ is often useful.</td>
<div class="ulist"><ul>
<li>
<p>
-<code>tag &lt;tag&gt;</code> means the same as <code>refs/tags/&lt;tag&gt;:refs/tags/&lt;tag&gt;</code>;
+<tt>tag &lt;tag&gt;</tt> means the same as <tt>refs/tags/&lt;tag&gt;:refs/tags/&lt;tag&gt;</tt>;
it requests fetching everything up to the given tag.
</p>
</li>
@@ -1186,8 +1204,8 @@ rsync://host.xz/path/to/repo.git/
</ul></div>
<div class="paragraph"><p>This syntax is only recognized if there are no slashes before the
first colon. This helps differentiate a local path that contains a
-colon. For example the local path <code>foo:bar</code> could be specified as an
-absolute path or <code>./foo:bar</code> to avoid being misinterpreted as an ssh
+colon. For example the local path <tt>foo:bar</tt> could be specified as an
+absolute path or <tt>./foo:bar</tt> to avoid being misinterpreted as an ssh
url.</p></div>
<div class="paragraph"><p>The ssh and git protocols additionally support ~username expansion:</p></div>
<div class="ulist"><ul>
@@ -1244,15 +1262,15 @@ use will be rewritten into URLs that work), you can create a
configuration section of the form:</p></div>
<div class="listingblock">
<div class="content">
-<pre><code> [url "&lt;actual url base&gt;"]
- insteadOf = &lt;other url base&gt;</code></pre>
+<pre><tt> [url "&lt;actual url base&gt;"]
+ insteadOf = &lt;other url base&gt;</tt></pre>
</div></div>
<div class="paragraph"><p>For example, with this:</p></div>
<div class="listingblock">
<div class="content">
-<pre><code> [url "git://git.host.xz/"]
+<pre><tt> [url "git://git.host.xz/"]
insteadOf = host.xz:/path/to/
- insteadOf = work:</code></pre>
+ insteadOf = work:</tt></pre>
</div></div>
<div class="paragraph"><p>a URL like "work:repo.git" or like "host.xz:/path/to/repo.git" will be
rewritten in any context that takes a URL to be "git://git.host.xz/repo.git".</p></div>
@@ -1260,14 +1278,14 @@ rewritten in any context that takes a URL to be "git://git.host.xz/repo.git".</p
configuration section of the form:</p></div>
<div class="listingblock">
<div class="content">
-<pre><code> [url "&lt;actual url base&gt;"]
- pushInsteadOf = &lt;other url base&gt;</code></pre>
+<pre><tt> [url "&lt;actual url base&gt;"]
+ pushInsteadOf = &lt;other url base&gt;</tt></pre>
</div></div>
<div class="paragraph"><p>For example, with this:</p></div>
<div class="listingblock">
<div class="content">
-<pre><code> [url "ssh://example.org/"]
- pushInsteadOf = git://example.org/</code></pre>
+<pre><tt> [url "ssh://example.org/"]
+ pushInsteadOf = git://example.org/</tt></pre>
</div></div>
<div class="paragraph"><p>a URL like "git://example.org/path/to/repo.git" will be rewritten to
"ssh://example.org/path/to/repo.git" for pushes, but pulls will still
@@ -1278,21 +1296,21 @@ use the original URL.</p></div>
<h2 id="_remotes_a_id_remotes_a">REMOTES<a id="REMOTES"></a></h2>
<div class="sectionbody">
<div class="paragraph"><p>The name of one of the following can be used instead
-of a URL as <code>&lt;repository&gt;</code> argument:</p></div>
+of a URL as <tt>&lt;repository&gt;</tt> argument:</p></div>
<div class="ulist"><ul>
<li>
<p>
-a remote in the Git configuration file: <code>$GIT_DIR/config</code>,
+a remote in the Git configuration file: <tt>$GIT_DIR/config</tt>,
</p>
</li>
<li>
<p>
-a file in the <code>$GIT_DIR/remotes</code> directory, or
+a file in the <tt>$GIT_DIR/remotes</tt> directory, or
</p>
</li>
<li>
<p>
-a file in the <code>$GIT_DIR/branches</code> directory.
+a file in the <tt>$GIT_DIR/branches</tt> directory.
</p>
</li>
</ul></div>
@@ -1302,65 +1320,65 @@ because they each contain a refspec which git will use by default.</p></div>
<h3 id="_named_remote_in_configuration_file">Named remote in configuration file</h3>
<div class="paragraph"><p>You can choose to provide the name of a remote which you had previously
configured using <a href="git-remote.html">git-remote(1)</a>, <a href="git-config.html">git-config(1)</a>
-or even by a manual edit to the <code>$GIT_DIR/config</code> file. The URL of
+or even by a manual edit to the <tt>$GIT_DIR/config</tt> file. The URL of
this remote will be used to access the repository. The refspec
of this remote will be used by default when you do
not provide a refspec on the command line. The entry in the
config file would appear like this:</p></div>
<div class="listingblock">
<div class="content">
-<pre><code> [remote "&lt;name&gt;"]
+<pre><tt> [remote "&lt;name&gt;"]
url = &lt;url&gt;
pushurl = &lt;pushurl&gt;
push = &lt;refspec&gt;
- fetch = &lt;refspec&gt;</code></pre>
+ fetch = &lt;refspec&gt;</tt></pre>
</div></div>
-<div class="paragraph"><p>The <code>&lt;pushurl&gt;</code> is used for pushes only. It is optional and defaults
-to <code>&lt;url&gt;</code>.</p></div>
+<div class="paragraph"><p>The <tt>&lt;pushurl&gt;</tt> is used for pushes only. It is optional and defaults
+to <tt>&lt;url&gt;</tt>.</p></div>
</div>
<div class="sect2">
-<h3 id="_named_file_in_code_git_dir_remotes_code">Named file in <code>$GIT_DIR/remotes</code></h3>
+<h3 id="_named_file_in_tt_git_dir_remotes_tt">Named file in <tt>$GIT_DIR/remotes</tt></h3>
<div class="paragraph"><p>You can choose to provide the name of a
-file in <code>$GIT_DIR/remotes</code>. The URL
+file in <tt>$GIT_DIR/remotes</tt>. The URL
in this file will be used to access the repository. The refspec
in this file will be used as default when you do not
provide a refspec on the command line. This file should have the
following format:</p></div>
<div class="listingblock">
<div class="content">
-<pre><code> URL: one of the above URL format
+<pre><tt> URL: one of the above URL format
Push: &lt;refspec&gt;
- Pull: &lt;refspec&gt;</code></pre>
+ Pull: &lt;refspec&gt;</tt></pre>
</div></div>
-<div class="paragraph"><p><code>Push:</code> lines are used by <em>git push</em> and
-<code>Pull:</code> lines are used by <em>git pull</em> and <em>git fetch</em>.
-Multiple <code>Push:</code> and <code>Pull:</code> lines may
+<div class="paragraph"><p><tt>Push:</tt> lines are used by <em>git push</em> and
+<tt>Pull:</tt> lines are used by <em>git pull</em> and <em>git fetch</em>.
+Multiple <tt>Push:</tt> and <tt>Pull:</tt> lines may
be specified for additional branch mappings.</p></div>
</div>
<div class="sect2">
-<h3 id="_named_file_in_code_git_dir_branches_code">Named file in <code>$GIT_DIR/branches</code></h3>
+<h3 id="_named_file_in_tt_git_dir_branches_tt">Named file in <tt>$GIT_DIR/branches</tt></h3>
<div class="paragraph"><p>You can choose to provide the name of a
-file in <code>$GIT_DIR/branches</code>.
+file in <tt>$GIT_DIR/branches</tt>.
The URL in this file will be used to access the repository.
This file should have the following format:</p></div>
<div class="listingblock">
<div class="content">
-<pre><code> &lt;url&gt;#&lt;head&gt;</code></pre>
+<pre><tt> &lt;url&gt;#&lt;head&gt;</tt></pre>
</div></div>
-<div class="paragraph"><p><code>&lt;url&gt;</code> is required; <code>#&lt;head&gt;</code> is optional.</p></div>
+<div class="paragraph"><p><tt>&lt;url&gt;</tt> is required; <tt>#&lt;head&gt;</tt> is optional.</p></div>
<div class="paragraph"><p>Depending on the operation, git will use one of the following
refspecs, if you don&#8217;t provide one on the command line.
-<code>&lt;branch&gt;</code> is the name of this file in <code>$GIT_DIR/branches</code> and
-<code>&lt;head&gt;</code> defaults to <code>master</code>.</p></div>
+<tt>&lt;branch&gt;</tt> is the name of this file in <tt>$GIT_DIR/branches</tt> and
+<tt>&lt;head&gt;</tt> defaults to <tt>master</tt>.</p></div>
<div class="paragraph"><p>git fetch uses:</p></div>
<div class="listingblock">
<div class="content">
-<pre><code> refs/heads/&lt;head&gt;:refs/heads/&lt;branch&gt;</code></pre>
+<pre><tt> refs/heads/&lt;head&gt;:refs/heads/&lt;branch&gt;</tt></pre>
</div></div>
<div class="paragraph"><p>git push uses:</p></div>
<div class="listingblock">
<div class="content">
-<pre><code> HEAD:refs/heads/&lt;head&gt;</code></pre>
+<pre><tt> HEAD:refs/heads/&lt;head&gt;</tt></pre>
</div></div>
</div>
</div>
@@ -1375,7 +1393,7 @@ Update the remote-tracking branches:
</p>
<div class="listingblock">
<div class="content">
-<pre><code>$ git fetch origin</code></pre>
+<pre><tt>$ git fetch origin</tt></pre>
</div></div>
<div class="paragraph"><p>The above command copies all branches from the remote refs/heads/
namespace and stores them to the local refs/remotes/origin/ namespace,
@@ -1388,13 +1406,13 @@ Using refspecs explicitly:
</p>
<div class="listingblock">
<div class="content">
-<pre><code>$ git fetch origin +pu:pu maint:tmp</code></pre>
+<pre><tt>$ git fetch origin +pu:pu maint:tmp</tt></pre>
</div></div>
-<div class="paragraph"><p>This updates (or creates, as necessary) branches <code>pu</code> and <code>tmp</code> in
+<div class="paragraph"><p>This updates (or creates, as necessary) branches <tt>pu</tt> and <tt>tmp</tt> in
the local repository by fetching from the branches (respectively)
-<code>pu</code> and <code>maint</code> from the remote repository.</p></div>
-<div class="paragraph"><p>The <code>pu</code> branch will be updated even if it is does not fast-forward,
-because it is prefixed with a plus sign; <code>tmp</code> will not be.</p></div>
+<tt>pu</tt> and <tt>maint</tt> from the remote repository.</p></div>
+<div class="paragraph"><p>The <tt>pu</tt> branch will be updated even if it is does not fast-forward,
+because it is prefixed with a plus sign; <tt>tmp</tt> will not be.</p></div>
</li>
</ul></div>
</div>