1 <?xml version="1.0" encoding="UTF-8"?>
\r
2 <!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
\r
4 <article lang="en" id="git-remote(1)">
\r
6 <title>git-remote(1)</title>
\r
8 <primary>git-remote(1)</primary>
\r
11 <simplesect id="_name">
\r
13 <simpara>git-remote - manage set of tracked repositories</simpara>
\r
15 <simplesect id="_synopsis">
\r
16 <title>SYNOPSIS</title>
\r
18 <literallayout><emphasis>git remote</emphasis> [-v | --verbose]
\r
19 <emphasis>git remote add</emphasis> [-t <branch>] [-m <master>] [-f] [--mirror] <name> <url>
\r
20 <emphasis>git remote rename</emphasis> <old> <new>
\r
21 <emphasis>git remote rm</emphasis> <name>
\r
22 <emphasis>git remote show</emphasis> [-n] <name>
\r
23 <emphasis>git remote prune</emphasis> [-n | --dry-run] <name>
\r
24 <emphasis>git remote update</emphasis> [group]</literallayout>
\r
27 <simplesect id="_description">
\r
28 <title>DESCRIPTION</title>
\r
29 <simpara>Manage the set of repositories ("remotes") whose branches you track.</simpara>
\r
31 <simplesect id="_options">
\r
32 <title>OPTIONS</title>
\r
43 Be a little more verbose and show remote url after name.
\r
49 <simplesect id="_commands">
\r
50 <title>COMMANDS</title>
\r
51 <simpara>With no arguments, shows a list of existing remotes. Several
\r
52 subcommands are available to perform operations on the remotes.</simpara>
\r
56 <emphasis>add</emphasis>
\r
60 Adds a remote named <name> for the repository at
\r
61 <url>. The command <literal>git fetch <name></literal> can then be used to create and
\r
62 update remote-tracking branches <name>/<branch>.
\r
64 <simpara>With <literal>-f</literal> option, <literal>git fetch <name></literal> is run immediately after
\r
65 the remote information is set up.</simpara>
\r
66 <simpara>With <literal>-t <branch></literal> option, instead of the default glob
\r
67 refspec for the remote to track all branches under
\r
68 <literal>$GIT_DIR/remotes/<name>/</literal>, a refspec to track only <literal><branch></literal>
\r
69 is created. You can give more than one <literal>-t <branch></literal> to track
\r
70 multiple branches without grabbing all branches.</simpara>
\r
71 <simpara>With <literal>-m <master></literal> option, <literal>$GIT_DIR/remotes/<name>/HEAD</literal> is set
\r
72 up to point at remote’s <literal><master></literal> branch instead of whatever
\r
73 branch the <literal>HEAD</literal> at the remote repository actually points at.</simpara>
\r
74 <simpara>In mirror mode, enabled with <literal>--mirror</literal>, the refs will not be stored
\r
75 in the <emphasis>refs/remotes/</emphasis> namespace, but in <emphasis>refs/heads/</emphasis>. This option
\r
76 only makes sense in bare repositories. If a remote uses mirror
\r
77 mode, furthermore, <literal>git push</literal> will always behave as if <literal>--mirror</literal>
\r
78 was passed.</simpara>
\r
83 <emphasis>rename</emphasis>
\r
87 Rename the remote named <old> to <new>. All remote tracking branches and
\r
88 configuration settings for the remote are updated.
\r
90 <simpara>In case <old> and <new> are the same, and <old> is a file under
\r
91 <literal>$GIT_DIR/remotes</literal> or <literal>$GIT_DIR/branches</literal>, the remote is converted to
\r
92 the configuration file format.</simpara>
\r
97 <emphasis>rm</emphasis>
\r
101 Remove the remote named <name>. All remote tracking branches and
\r
102 configuration settings for the remote are removed.
\r
108 <emphasis>show</emphasis>
\r
112 Gives some information about the remote <name>.
\r
114 <simpara>With <literal>-n</literal> option, the remote heads are not queried first with
\r
115 <literal>git ls-remote <name></literal>; cached information is used instead.</simpara>
\r
120 <emphasis>prune</emphasis>
\r
124 Deletes all stale tracking branches under <name>.
\r
125 These stale branches have already been removed from the remote repository
\r
126 referenced by <name>, but are still locally available in
\r
127 "remotes/<name>".
\r
129 <simpara>With <literal>--dry-run</literal> option, report what branches will be pruned, but do no
\r
130 actually prune them.</simpara>
\r
135 <emphasis>update</emphasis>
\r
139 Fetch updates for a named set of remotes in the repository as defined by
\r
140 remotes.<group>. If a named group is not specified on the command line,
\r
141 the configuration parameter remotes.default will get used; if
\r
142 remotes.default is not defined, all remotes which do not have the
\r
143 configuration parameter remote.<name>.skipDefaultUpdate set to true will
\r
144 be updated. (See <xref linkend="git-config(1)"/>).
\r
150 <simplesect id="_discussion">
\r
151 <title>DISCUSSION</title>
\r
152 <simpara>The remote configuration is achieved using the <literal>remote.origin.url</literal> and
\r
153 <literal>remote.origin.fetch</literal> configuration variables. (See
\r
154 <xref linkend="git-config(1)"/>).</simpara>
\r
156 <simplesect id="_examples">
\r
157 <title>Examples</title>
\r
161 Add a new remote, fetch, and check out a branch from it
\r
163 <literallayout>$ git remote
\r
167 $ git remote add linux-nfs git://linux-nfs.org/pub/linux/nfs-2.6.git
\r
172 * refs/remotes/linux-nfs/master: storing branch 'master' ...
\r
177 $ git checkout -b nfs linux-nfs/master
\r
178 ...</literallayout>
\r
182 Imitate <emphasis>git-clone</emphasis> but track only selected branches
\r
184 <literallayout>$ mkdir project.git
\r
187 $ git remote add -f -t master -m master origin git://example.com/git.git/
\r
188 $ git merge origin</literallayout>
\r
192 <simplesect id="_see_also">
\r
193 <title>SEE ALSO</title>
\r
194 <simpara><xref linkend="git-fetch(1)"/>
\r
195 <xref linkend="git-branch(1)"/>
\r
196 <xref linkend="git-config(1)"/></simpara>
\r
198 <simplesect id="_author">
\r
199 <title>Author</title>
\r
200 <simpara>Written by Junio Hamano</simpara>
\r
202 <simplesect id="_documentation">
\r
203 <title>Documentation</title>
\r
204 <simpara>Documentation by J. Bruce Fields and the git-list <<ulink url="mailto:git@vger.kernel.org">git@vger.kernel.org</ulink>>.</simpara>
\r
206 <simplesect id="_git">
\r
208 <simpara>Part of the <xref linkend="git(1)"/> suite</simpara>
\r