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.47.0.305.g4083a6f052
10 .TH "GIT\-REMOTE" "1" "2024-11-20" "Git 2\&.47\&.0\&.305\&.g4083a6" "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
71 can then be used to create and update remote\-tracking branches <name>/<branch>\&.
79 is run immediately after the remote information is set up\&.
87 imports every tag from the remote repository\&.
95 does not import tags from the remote repository\&.
97 By default, only tags on fetched branches are imported (see
98 \fBgit-fetch\fR(1))\&.
103 option, instead of the default glob refspec for the remote to track all branches under the
104 \fBrefs/remotes/\fR\fI<name>\fR\fB/\fR
105 namespace, a refspec to track only
107 is created\&. You can give more than one
110 to track multiple branches without grabbing all branches\&.
115 option, a symbolic\-ref
116 \fBrefs/remotes/\fR\fI<name>\fR\fB/HEAD\fR
117 is set up to point at remote\(cqs
119 branch\&. See also the set\-head command\&.
121 When a fetch mirror is created with
122 \fB\-\-mirror=fetch\fR, the refs will not be stored in the
124 namespace, but rather everything in
126 on the remote will be directly mirrored into
128 in the local repository\&. This option only makes sense in bare repositories, because a fetch would overwrite any local commits\&.
130 When a push mirror is created with
131 \fB\-\-mirror=push\fR, then
134 will always behave as if
141 Rename the remote named <old> to <new>\&. All remote\-tracking branches and configuration settings for the remote are updated\&.
143 In case <old> and <new> are the same, and <old> is a file under
144 \fB$GIT_DIR/remotes\fR
146 \fB$GIT_DIR/branches\fR, the remote is converted to the configuration file format\&.
149 \fIremove\fR, \fIrm\fR
151 Remove the remote named <name>\&. All remote\-tracking branches and configuration settings for the remote are removed\&.
156 Sets or deletes the default branch (i\&.e\&. the target of the symbolic\-ref
157 \fBrefs/remotes/\fR\fI<name>\fR\fB/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
162 may be specified wherever you would normally specify
163 \fBorigin/master\fR\&.
168 \fB\-\-delete\fR, the symbolic ref
169 \fBrefs/remotes/\fR\fI<name>\fR\fB/HEAD\fR
175 \fB\-\-auto\fR, the remote is queried to determine its
176 \fBHEAD\fR, then the symbolic\-ref
177 \fBrefs/remotes/\fR\fI<name>\fR\fB/HEAD\fR
178 is set to the same branch\&. e\&.g\&., if the remote
187 will set the symbolic\-ref
188 \fBrefs/remotes/origin/HEAD\fR
190 \fBrefs/remotes/origin/next\fR\&. This will only work if
191 \fBrefs/remotes/origin/next\fR
192 already exists; if not it must be fetched first\&.
196 to set the symbolic\-ref
197 \fBrefs/remotes/\fR\fI<name>\fR\fB/HEAD\fR
198 explicitly\&. e\&.g\&.,
204 will set the symbolic\-ref
205 \fBrefs/remotes/origin/HEAD\fR
207 \fBrefs/remotes/origin/master\fR\&. This will only work if
208 \fBrefs/remotes/origin/master\fR
209 already exists; if not it must be fetched first\&.
214 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\&.
216 The named branches will be interpreted as if specified with the
225 \fB\-\-add\fR, instead of replacing the list of currently tracked branches, adds to that list\&.
230 Retrieves the URLs for a remote\&. Configurations for
234 are expanded here\&. By default, only the first URL is listed\&.
237 \fB\-\-push\fR, push URLs are queried rather than fetch URLs\&.
240 \fB\-\-all\fR, all URLs for the remote will be listed\&.
245 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\&.
248 \fB\-\-push\fR, push URLs are manipulated instead of fetch URLs\&.
251 \fB\-\-add\fR, instead of changing existing URLs, new URL is added\&.
254 \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\&.
256 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\&.
261 Gives some information about the remote <name>\&.
265 option, the remote heads are not queried first with
268 \fI<name>\fR; cached information is used instead\&.
273 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
277 \fI<name>\fR, except that no new references will be fetched\&.
279 See the PRUNING section of
281 for what it\(cqll prune depending on various configuration\&.
285 option, report what branches would be pruned, but do not actually prune them\&.
290 Fetch updates for remotes or remote groups in the repository as defined by
291 \fBremotes\&.\fR\fI<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
292 \fBremote\&.\fR\fI<name>\fR\fB\&.skipDefaultUpdate\fR
293 set to true will be updated\&. (See
294 \fBgit-config\fR(1))\&.
298 option, run pruning against all the remotes that are updated\&.
302 The remote configuration is achieved using the \fBremote\&.origin\&.url\fR and \fBremote\&.origin\&.fetch\fR configuration variables\&. (See \fBgit-config\fR(1))\&.
305 On success, the exit status is \fB0\fR\&.
307 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\&.
309 On any other error, the exit status may be any other non\-zero value\&.
320 Add a new remote, fetch, and check out a branch from it
329 origin/HEAD \-> origin/master
331 $ git remote add staging git://git\&.kernel\&.org/\&.\&.\&./gregkh/staging\&.git
337 From git://git\&.kernel\&.org/pub/scm/linux/kernel/git/gregkh/staging
338 * [new branch] master \-> staging/master
339 * [new branch] staging\-linus \-> staging/staging\-linus
340 * [new branch] staging\-next \-> staging/staging\-next
342 origin/HEAD \-> origin/master
345 staging/staging\-linus
346 staging/staging\-next
347 $ git switch \-c staging staging/master
365 but track only selected branches
371 $ mkdir project\&.git
374 $ git remote add \-f \-t master \-m master origin git://example\&.com/git\&.git/
383 \fBgit-fetch\fR(1) \fBgit-branch\fR(1) \fBgit-config\fR(1)
386 Part of the \fBgit\fR(1) suite