3 .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author]
4 .\" Generator: DocBook XSL Stylesheets v1.79.2 <http://docbook.sf.net/>
7 .\" Source: Git 2.46.0.46.g406f326d27
10 .TH "GIT\-REMOTE" "1" "2024-08-01" "Git 2\&.46\&.0\&.46\&.g406f326" "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>)\&...\:]
51 Manage the set of repositories ("remotes") whose branches you track\&.
56 Be a little more verbose and show remote url after name\&. For promisor remotes, also show which filters (\fBblob:none\fR
57 etc\&.) are configured\&. NOTE: This must be placed between
63 With no arguments, shows a list of existing remotes\&. Several subcommands are available to perform operations on the remotes\&.
67 Add a remote named <name> for the repository at <URL>\&. The command
68 \fBgit fetch <name>\fR
69 can then be used to create and update remote\-tracking branches <name>/<branch>\&.
74 \fBgit fetch <name>\fR
75 is run immediately after the remote information is set up\&.
80 \fBgit fetch <name>\fR
81 imports every tag from the remote repository\&.
86 \fBgit fetch <name>\fR
87 does not import tags from the remote repository\&.
89 By default, only tags on fetched branches are imported (see
90 \fBgit-fetch\fR(1))\&.
94 option, instead of the default glob refspec for the remote to track all branches under the
95 \fBrefs/remotes/<name>/\fR
96 namespace, a refspec to track only
98 is created\&. You can give more than one
100 to track multiple branches without grabbing all branches\&.
104 option, a symbolic\-ref
105 \fBrefs/remotes/<name>/HEAD\fR
106 is set up to point at remote\(cqs
108 branch\&. See also the set\-head command\&.
110 When a fetch mirror is created with
111 \fB\-\-mirror=fetch\fR, the refs will not be stored in the
113 namespace, but rather everything in
115 on the remote will be directly mirrored into
117 in the local repository\&. This option only makes sense in bare repositories, because a fetch would overwrite any local commits\&.
119 When a push mirror is created with
120 \fB\-\-mirror=push\fR, then
122 will always behave as if
129 Rename the remote named <old> to <new>\&. All remote\-tracking branches and configuration settings for the remote are updated\&.
131 In case <old> and <new> are the same, and <old> is a file under
132 \fB$GIT_DIR/remotes\fR
134 \fB$GIT_DIR/branches\fR, the remote is converted to the configuration file format\&.
137 \fIremove\fR, \fIrm\fR
139 Remove the remote named <name>\&. All remote\-tracking branches and configuration settings for the remote are removed\&.
144 Sets or deletes the default branch (i\&.e\&. the target of the symbolic\-ref
145 \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
150 may be specified wherever you would normally specify
151 \fBorigin/master\fR\&.
156 \fB\-\-delete\fR, the symbolic ref
157 \fBrefs/remotes/<name>/HEAD\fR
163 \fB\-\-auto\fR, the remote is queried to determine its
164 \fBHEAD\fR, then the symbolic\-ref
165 \fBrefs/remotes/<name>/HEAD\fR
166 is set to the same branch\&. e\&.g\&., if the remote
170 \fBgit remote set\-head origin \-a\fR
171 will set the symbolic\-ref
172 \fBrefs/remotes/origin/HEAD\fR
174 \fBrefs/remotes/origin/next\fR\&. This will only work if
175 \fBrefs/remotes/origin/next\fR
176 already exists; if not it must be fetched first\&.
180 to set the symbolic\-ref
181 \fBrefs/remotes/<name>/HEAD\fR
182 explicitly\&. e\&.g\&.,
183 \fBgit remote set\-head origin master\fR
184 will set the symbolic\-ref
185 \fBrefs/remotes/origin/HEAD\fR
187 \fBrefs/remotes/origin/master\fR\&. This will only work if
188 \fBrefs/remotes/origin/master\fR
189 already exists; if not it must be fetched first\&.
194 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\&.
196 The named branches will be interpreted as if specified with the
203 \fB\-\-add\fR, instead of replacing the list of currently tracked branches, adds to that list\&.
208 Retrieves the URLs for a remote\&. Configurations for
212 are expanded here\&. By default, only the first URL is listed\&.
215 \fB\-\-push\fR, push URLs are queried rather than fetch URLs\&.
218 \fB\-\-all\fR, all URLs for the remote will be listed\&.
223 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\&.
226 \fB\-\-push\fR, push URLs are manipulated instead of fetch URLs\&.
229 \fB\-\-add\fR, instead of changing existing URLs, new URL is added\&.
232 \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\&.
234 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\&.
239 Gives some information about the remote <name>\&.
243 option, the remote heads are not queried first with
244 \fBgit ls\-remote <name>\fR; cached information is used instead\&.
249 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
250 \fBgit fetch \-\-prune <name>\fR, except that no new references will be fetched\&.
252 See the PRUNING section of
254 for what it\(cqll prune depending on various configuration\&.
258 option, report what branches would be pruned, but do not actually prune them\&.
263 Fetch updates for remotes or remote groups in the repository as defined by
264 \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
265 \fBremote\&.<name>\&.skipDefaultUpdate\fR
266 set to true will be updated\&. (See
267 \fBgit-config\fR(1))\&.
271 option, run pruning against all the remotes that are updated\&.
275 The remote configuration is achieved using the \fBremote\&.origin\&.url\fR and \fBremote\&.origin\&.fetch\fR configuration variables\&. (See \fBgit-config\fR(1))\&.
278 On success, the exit status is \fB0\fR\&.
280 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\&.
282 On any other error, the exit status may be any other non\-zero value\&.
293 Add a new remote, fetch, and check out a branch from it
302 origin/HEAD \-> origin/master
304 $ git remote add staging git://git\&.kernel\&.org/\&.\&.\&./gregkh/staging\&.git
310 From git://git\&.kernel\&.org/pub/scm/linux/kernel/git/gregkh/staging
311 * [new branch] master \-> staging/master
312 * [new branch] staging\-linus \-> staging/staging\-linus
313 * [new branch] staging\-next \-> staging/staging\-next
315 origin/HEAD \-> origin/master
318 staging/staging\-linus
319 staging/staging\-next
320 $ git switch \-c staging staging/master
338 but track only selected branches
344 $ mkdir project\&.git
347 $ git remote add \-f \-t master \-m master origin git://example\&.com/git\&.git/
356 \fBgit-fetch\fR(1) \fBgit-branch\fR(1) \fBgit-config\fR(1)
359 Part of the \fBgit\fR(1) suite