OSDN Git Service

Add Git official document to help
[tortoisegit/TortoiseGitJp.git] / doc / source / en / TortoiseGit / git_doc / git-remote.html.xml
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
3 \r
4 <article lang="en" id="git-remote(1)">\r
5 <articleinfo>\r
6     <title>git-remote(1)</title>\r
7         <indexterm>\r
8                 <primary>git-remote(1)</primary>\r
9         </indexterm>\r
10 </articleinfo>\r
11 <simplesect id="_name">\r
12 <title>NAME</title>\r
13 <simpara>git-remote - manage set of tracked repositories</simpara>\r
14 </simplesect>\r
15 <simplesect id="_synopsis">\r
16 <title>SYNOPSIS</title>\r
17 <blockquote>\r
18 <literallayout><emphasis>git remote</emphasis> [-v | --verbose]\r
19 <emphasis>git remote add</emphasis> [-t &lt;branch&gt;] [-m &lt;master&gt;] [-f] [--mirror] &lt;name&gt; &lt;url&gt;\r
20 <emphasis>git remote rename</emphasis> &lt;old&gt; &lt;new&gt;\r
21 <emphasis>git remote rm</emphasis> &lt;name&gt;\r
22 <emphasis>git remote show</emphasis> [-n] &lt;name&gt;\r
23 <emphasis>git remote prune</emphasis> [-n | --dry-run] &lt;name&gt;\r
24 <emphasis>git remote update</emphasis> [group]</literallayout>\r
25 </blockquote>\r
26 </simplesect>\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
30 </simplesect>\r
31 <simplesect id="_options">\r
32 <title>OPTIONS</title>\r
33 <variablelist>\r
34 <varlistentry>\r
35 <term>\r
36 -v\r
37 </term>\r
38 <term>\r
39 --verbose\r
40 </term>\r
41 <listitem>\r
42 <simpara>\r
43         Be a little more verbose and show remote url after name.\r
44 </simpara>\r
45 </listitem>\r
46 </varlistentry>\r
47 </variablelist>\r
48 </simplesect>\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
53 <variablelist>\r
54 <varlistentry>\r
55 <term>\r
56 <emphasis>add</emphasis>\r
57 </term>\r
58 <listitem>\r
59 <simpara>\r
60 Adds a remote named &lt;name&gt; for the repository at\r
61 &lt;url&gt;.  The command <literal>git fetch &lt;name&gt;</literal> can then be used to create and\r
62 update remote-tracking branches &lt;name&gt;/&lt;branch&gt;.\r
63 </simpara>\r
64 <simpara>With <literal>-f</literal> option, <literal>git fetch &lt;name&gt;</literal> is run immediately after\r
65 the remote information is set up.</simpara>\r
66 <simpara>With <literal>-t &lt;branch&gt;</literal> option, instead of the default glob\r
67 refspec for the remote to track all branches under\r
68 <literal>$GIT_DIR/remotes/&lt;name&gt;/</literal>, a refspec to track only <literal>&lt;branch&gt;</literal>\r
69 is created.  You can give more than one <literal>-t &lt;branch&gt;</literal> to track\r
70 multiple branches without grabbing all branches.</simpara>\r
71 <simpara>With <literal>-m &lt;master&gt;</literal> option, <literal>$GIT_DIR/remotes/&lt;name&gt;/HEAD</literal> is set\r
72 up to point at remote&#8217;s <literal>&lt;master&gt;</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
79 </listitem>\r
80 </varlistentry>\r
81 <varlistentry>\r
82 <term>\r
83 <emphasis>rename</emphasis>\r
84 </term>\r
85 <listitem>\r
86 <simpara>\r
87 Rename the remote named &lt;old&gt; to &lt;new&gt;. All remote tracking branches and\r
88 configuration settings for the remote are updated.\r
89 </simpara>\r
90 <simpara>In case &lt;old&gt; and &lt;new&gt; are the same, and &lt;old&gt; 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
93 </listitem>\r
94 </varlistentry>\r
95 <varlistentry>\r
96 <term>\r
97 <emphasis>rm</emphasis>\r
98 </term>\r
99 <listitem>\r
100 <simpara>\r
101 Remove the remote named &lt;name&gt;. All remote tracking branches and\r
102 configuration settings for the remote are removed.\r
103 </simpara>\r
104 </listitem>\r
105 </varlistentry>\r
106 <varlistentry>\r
107 <term>\r
108 <emphasis>show</emphasis>\r
109 </term>\r
110 <listitem>\r
111 <simpara>\r
112 Gives some information about the remote &lt;name&gt;.\r
113 </simpara>\r
114 <simpara>With <literal>-n</literal> option, the remote heads are not queried first with\r
115 <literal>git ls-remote &lt;name&gt;</literal>; cached information is used instead.</simpara>\r
116 </listitem>\r
117 </varlistentry>\r
118 <varlistentry>\r
119 <term>\r
120 <emphasis>prune</emphasis>\r
121 </term>\r
122 <listitem>\r
123 <simpara>\r
124 Deletes all stale tracking branches under &lt;name&gt;.\r
125 These stale branches have already been removed from the remote repository\r
126 referenced by &lt;name&gt;, but are still locally available in\r
127 "remotes/&lt;name&gt;".\r
128 </simpara>\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
131 </listitem>\r
132 </varlistentry>\r
133 <varlistentry>\r
134 <term>\r
135 <emphasis>update</emphasis>\r
136 </term>\r
137 <listitem>\r
138 <simpara>\r
139 Fetch updates for a named set of remotes in the repository as defined by\r
140 remotes.&lt;group&gt;.  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.&lt;name&gt;.skipDefaultUpdate set to true will\r
144 be updated.  (See <xref linkend="git-config(1)"/>).\r
145 </simpara>\r
146 </listitem>\r
147 </varlistentry>\r
148 </variablelist>\r
149 </simplesect>\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
155 </simplesect>\r
156 <simplesect id="_examples">\r
157 <title>Examples</title>\r
158 <itemizedlist>\r
159 <listitem>\r
160 <simpara>\r
161 Add a new remote, fetch, and check out a branch from it\r
162 </simpara>\r
163 <literallayout>$ git remote\r
164 origin\r
165 $ git branch -r\r
166 origin/master\r
167 $ git remote add linux-nfs git://linux-nfs.org/pub/linux/nfs-2.6.git\r
168 $ git remote\r
169 linux-nfs\r
170 origin\r
171 $ git fetch\r
172 * refs/remotes/linux-nfs/master: storing branch 'master' ...\r
173   commit: bf81b46\r
174 $ git branch -r\r
175 origin/master\r
176 linux-nfs/master\r
177 $ git checkout -b nfs linux-nfs/master\r
178 ...</literallayout>\r
179 </listitem>\r
180 <listitem>\r
181 <simpara>\r
182 Imitate <emphasis>git-clone</emphasis> but track only selected branches\r
183 </simpara>\r
184 <literallayout>$ mkdir project.git\r
185 $ cd project.git\r
186 $ git init\r
187 $ git remote add -f -t master -m master origin git://example.com/git.git/\r
188 $ git merge origin</literallayout>\r
189 </listitem>\r
190 </itemizedlist>\r
191 </simplesect>\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
197 </simplesect>\r
198 <simplesect id="_author">\r
199 <title>Author</title>\r
200 <simpara>Written by Junio Hamano</simpara>\r
201 </simplesect>\r
202 <simplesect id="_documentation">\r
203 <title>Documentation</title>\r
204 <simpara>Documentation by J. Bruce Fields and the git-list &lt;<ulink url="mailto:git@vger.kernel.org">git@vger.kernel.org</ulink>&gt;.</simpara>\r
205 </simplesect>\r
206 <simplesect id="_git">\r
207 <title>GIT</title>\r
208 <simpara>Part of the <xref linkend="git(1)"/> suite</simpara>\r
209 </simplesect>\r
210 </article>\r