3 .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author]
4 .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
7 .\" Source: Git 2.41.0.rc0.4.g004e0f790f
10 .TH "GIT\-REMOTE" "1" "2023\-05\-17" "Git 2\&.41\&.0\&.rc0\&.4\&.g00" "Git Manual"
11 .\" -----------------------------------------------------------------
12 .\" * Define some portability stuff
13 .\" -----------------------------------------------------------------
14 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15 .\" http://bugs.debian.org/507673
16 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
20 .\" -----------------------------------------------------------------
21 .\" * set default formatting
22 .\" -----------------------------------------------------------------
23 .\" disable hyphenation
25 .\" disable justification (adjust text to left margin only)
27 .\" -----------------------------------------------------------------
28 .\" * MAIN CONTENT STARTS HERE *
29 .\" -----------------------------------------------------------------
31 git-remote \- Manage set of tracked repositories
35 \fIgit remote\fR [\-v | \-\-verbose]
36 \fIgit remote add\fR [\-t <branch>] [\-m <master>] [\-f] [\-\-[no\-]tags] [\-\-mirror=(fetch|push)] <name> <URL>
37 \fIgit remote rename\fR [\-\-[no\-]progress] <old> <new>
38 \fIgit remote remove\fR <name>
39 \fIgit remote set\-head\fR <name> (\-a | \-\-auto | \-d | \-\-delete | <branch>)
40 \fIgit remote set\-branches\fR [\-\-add] <name> <branch>\&...
41 \fIgit remote get\-url\fR [\-\-push] [\-\-all] <name>
42 \fIgit remote set\-url\fR [\-\-push] <name> <newurl> [<oldurl>]
43 \fIgit remote set\-url \-\-add\fR [\-\-push] <name> <newurl>
44 \fIgit remote set\-url \-\-delete\fR [\-\-push] <name> <URL>
45 \fIgit remote\fR [\-v | \-\-verbose] \fIshow\fR [\-n] <name>\&...
46 \fIgit remote prune\fR [\-n | \-\-dry\-run] <name>\&...
47 \fIgit remote\fR [\-v | \-\-verbose] \fIupdate\fR [\-p | \-\-prune] [(<group> | <remote>)\&...]
52 Manage the set of repositories ("remotes") whose branches you track\&.
57 Be a little more verbose and show remote url after name\&. For promisor remotes, also show which filter (\fBblob:none\fR
58 etc\&.) are configured\&. NOTE: This must be placed between
64 With no arguments, shows a list of existing remotes\&. Several subcommands are available to perform operations on the remotes\&.
68 Add a remote named <name> for the repository at <URL>\&. The command
69 \fBgit fetch <name>\fR
70 can then be used to create and update remote\-tracking branches <name>/<branch>\&.
75 \fBgit fetch <name>\fR
76 is run immediately after the remote information is set up\&.
81 \fBgit fetch <name>\fR
82 imports every tag from the remote repository\&.
87 \fBgit fetch <name>\fR
88 does not import tags from the remote repository\&.
90 By default, only tags on fetched branches are imported (see
91 \fBgit-fetch\fR(1))\&.
95 option, instead of the default glob refspec for the remote to track all branches under the
96 \fBrefs/remotes/<name>/\fR
97 namespace, a refspec to track only
99 is created\&. You can give more than one
101 to track multiple branches without grabbing all branches\&.
105 option, a symbolic\-ref
106 \fBrefs/remotes/<name>/HEAD\fR
107 is set up to point at remote\(cqs
109 branch\&. See also the set\-head command\&.
111 When a fetch mirror is created with
112 \fB\-\-mirror=fetch\fR, the refs will not be stored in the
114 namespace, but rather everything in
116 on the remote will be directly mirrored into
118 in the local repository\&. This option only makes sense in bare repositories, because a fetch would overwrite any local commits\&.
120 When a push mirror is created with
121 \fB\-\-mirror=push\fR, then
123 will always behave as if
130 Rename the remote named <old> to <new>\&. All remote\-tracking branches and configuration settings for the remote are updated\&.
132 In case <old> and <new> are the same, and <old> is a file under
133 \fB$GIT_DIR/remotes\fR
135 \fB$GIT_DIR/branches\fR, the remote is converted to the configuration file format\&.
138 \fIremove\fR, \fIrm\fR
140 Remove the remote named <name>\&. All remote\-tracking branches and configuration settings for the remote are removed\&.
145 Sets or deletes the default branch (i\&.e\&. the target of the symbolic\-ref
146 \fBrefs/remotes/<name>/HEAD\fR) for the named remote\&. Having a default branch for a remote is not required, but allows the name of the remote to be specified in lieu of a specific branch\&. For example, if the default branch for
151 may be specified wherever you would normally specify
152 \fBorigin/master\fR\&.
157 \fB\-\-delete\fR, the symbolic ref
158 \fBrefs/remotes/<name>/HEAD\fR
164 \fB\-\-auto\fR, the remote is queried to determine its
165 \fBHEAD\fR, then the symbolic\-ref
166 \fBrefs/remotes/<name>/HEAD\fR
167 is set to the same branch\&. e\&.g\&., if the remote
171 \fBgit remote set\-head origin \-a\fR
172 will set the symbolic\-ref
173 \fBrefs/remotes/origin/HEAD\fR
175 \fBrefs/remotes/origin/next\fR\&. This will only work if
176 \fBrefs/remotes/origin/next\fR
177 already exists; if not it must be fetched first\&.
181 to set the symbolic\-ref
182 \fBrefs/remotes/<name>/HEAD\fR
183 explicitly\&. e\&.g\&.,
184 \fBgit remote set\-head origin master\fR
185 will set the symbolic\-ref
186 \fBrefs/remotes/origin/HEAD\fR
188 \fBrefs/remotes/origin/master\fR\&. This will only work if
189 \fBrefs/remotes/origin/master\fR
190 already exists; if not it must be fetched first\&.
195 Changes the list of branches tracked by the named remote\&. This can be used to track a subset of the available remote branches after the initial setup for a remote\&.
197 The named branches will be interpreted as if specified with the
204 \fB\-\-add\fR, instead of replacing the list of currently tracked branches, adds to that list\&.
209 Retrieves the URLs for a remote\&. Configurations for
213 are expanded here\&. By default, only the first URL is listed\&.
216 \fB\-\-push\fR, push URLs are queried rather than fetch URLs\&.
219 \fB\-\-all\fR, all URLs for the remote will be listed\&.
224 Changes URLs for the remote\&. Sets first URL for remote <name> that matches regex <oldurl> (first URL if no <oldurl> is given) to <newurl>\&. If <oldurl> doesn\(cqt match any URL, an error occurs and nothing is changed\&.
227 \fB\-\-push\fR, push URLs are manipulated instead of fetch URLs\&.
230 \fB\-\-add\fR, instead of changing existing URLs, new URL is added\&.
233 \fB\-\-delete\fR, instead of changing existing URLs, all URLs matching regex <URL> are deleted for remote <name>\&. Trying to delete all non\-push URLs is an error\&.
235 Note that the push URL and the fetch URL, even though they can be set differently, must still refer to the same place\&. What you pushed to the push URL should be what you would see if you immediately fetched from the fetch URL\&. If you are trying to fetch from one place (e\&.g\&. your upstream) and push to another (e\&.g\&. your publishing repository), use two separate remotes\&.
240 Gives some information about the remote <name>\&.
244 option, the remote heads are not queried first with
245 \fBgit ls\-remote <name>\fR; cached information is used instead\&.
250 Deletes stale references associated with <name>\&. By default, stale remote\-tracking branches under <name> are deleted, but depending on global configuration and the configuration of the remote we might even prune local tags that haven\(cqt been pushed there\&. Equivalent to
251 \fBgit fetch \-\-prune <name>\fR, except that no new references will be fetched\&.
253 See the PRUNING section of
255 for what it\(cqll prune depending on various configuration\&.
259 option, report what branches would be pruned, but do not actually prune them\&.
264 Fetch updates for remotes or remote groups in the repository as defined by
265 \fBremotes\&.<group>\fR\&. If neither group nor remote is specified on the command line, the configuration parameter remotes\&.default will be used; if remotes\&.default is not defined, all remotes which do not have the configuration parameter
266 \fBremote\&.<name>\&.skipDefaultUpdate\fR
267 set to true will be updated\&. (See
268 \fBgit-config\fR(1))\&.
272 option, run pruning against all the remotes that are updated\&.
276 The remote configuration is achieved using the \fBremote\&.origin\&.url\fR and \fBremote\&.origin\&.fetch\fR configuration variables\&. (See \fBgit-config\fR(1))\&.
279 On success, the exit status is \fB0\fR\&.
281 When subcommands such as \fIadd\fR, \fIrename\fR, and \fIremove\fR can\(cqt find the remote in question, the exit status is \fB2\fR\&. When the remote already exists, the exit status is \fB3\fR\&.
283 On any other error, the exit status may be any other non\-zero value\&.
294 Add a new remote, fetch, and check out a branch from it
303 origin/HEAD \-> origin/master
305 $ git remote add staging git://git\&.kernel\&.org/\&.\&.\&./gregkh/staging\&.git
311 From git://git\&.kernel\&.org/pub/scm/linux/kernel/git/gregkh/staging
312 * [new branch] master \-> staging/master
313 * [new branch] staging\-linus \-> staging/staging\-linus
314 * [new branch] staging\-next \-> staging/staging\-next
316 origin/HEAD \-> origin/master
319 staging/staging\-linus
320 staging/staging\-next
321 $ git switch \-c staging staging/master
340 but track only selected branches
346 $ mkdir project\&.git
349 $ git remote add \-f \-t master \-m master origin git://example\&.com/git\&.git/
359 \fBgit-fetch\fR(1) \fBgit-branch\fR(1) \fBgit-config\fR(1)
362 Part of the \fBgit\fR(1) suite