git-gui: fix usage of themed widgets variable
[git/dscho.git] / Documentation / git-remote.txt
blob3fc599c0c7d5495ada81b20e4d37fa4936708270
1 git-remote(1)
2 ============
4 NAME
5 ----
6 git-remote - manage set of tracked repositories
9 SYNOPSIS
10 --------
11 [verse]
12 'git remote' [-v | --verbose]
13 'git remote add' [-t <branch>] [-m <master>] [-f] [--mirror] <name> <url>
14 'git remote rename' <old> <new>
15 'git remote rm' <name>
16 'git remote set-head' <name> (-a | -d | <branch>)
17 'git remote set-url' [--push] <name> <newurl> [<oldurl>]
18 'git remote set-url --add' [--push] <name> <newurl>
19 'git remote set-url --delete' [--push] <name> <url>
20 'git remote' [-v | --verbose] 'show' [-n] <name>
21 'git remote prune' [-n | --dry-run] <name>
22 'git remote' [-v | --verbose] 'update' [-p | --prune] [group | remote]...
24 DESCRIPTION
25 -----------
27 Manage the set of repositories ("remotes") whose branches you track.
30 OPTIONS
31 -------
33 -v::
34 --verbose::
35         Be a little more verbose and show remote url after name.
36         NOTE: This must be placed between `remote` and `subcommand`.
39 COMMANDS
40 --------
42 With no arguments, shows a list of existing remotes.  Several
43 subcommands are available to perform operations on the remotes.
45 'add'::
47 Adds a remote named <name> for the repository at
48 <url>.  The command `git fetch <name>` can then be used to create and
49 update remote-tracking branches <name>/<branch>.
51 With `-f` option, `git fetch <name>` is run immediately after
52 the remote information is set up.
54 With `-t <branch>` option, instead of the default glob
55 refspec for the remote to track all branches under
56 `$GIT_DIR/remotes/<name>/`, a refspec to track only `<branch>`
57 is created.  You can give more than one `-t <branch>` to track
58 multiple branches without grabbing all branches.
60 With `-m <master>` option, `$GIT_DIR/remotes/<name>/HEAD` is set
61 up to point at remote's `<master>` branch. See also the set-head command.
63 In mirror mode, enabled with `\--mirror`, the refs will not be stored
64 in the 'refs/remotes/' namespace, but in 'refs/heads/'.  This option
65 only makes sense in bare repositories.  If a remote uses mirror
66 mode, furthermore, `git push` will always behave as if `\--mirror`
67 was passed.
69 'rename'::
71 Rename the remote named <old> to <new>. All remote tracking branches and
72 configuration settings for the remote are updated.
74 In case <old> and <new> are the same, and <old> is a file under
75 `$GIT_DIR/remotes` or `$GIT_DIR/branches`, the remote is converted to
76 the configuration file format.
78 'rm'::
80 Remove the remote named <name>. All remote tracking branches and
81 configuration settings for the remote are removed.
83 'set-head'::
85 Sets or deletes the default branch (`$GIT_DIR/remotes/<name>/HEAD`) for
86 the named remote. Having a default branch for a remote is not required,
87 but allows the name of the remote to be specified in lieu of a specific
88 branch. For example, if the default branch for `origin` is set to
89 `master`, then `origin` may be specified wherever you would normally
90 specify `origin/master`.
92 With `-d`, `$GIT_DIR/remotes/<name>/HEAD` is deleted.
94 With `-a`, the remote is queried to determine its `HEAD`, then
95 `$GIT_DIR/remotes/<name>/HEAD` is set to the same branch. e.g., if the remote
96 `HEAD` is pointed at `next`, "`git remote set-head origin -a`" will set
97 `$GIT_DIR/refs/remotes/origin/HEAD` to `refs/remotes/origin/next`. This will
98 only work if `refs/remotes/origin/next` already exists; if not it must be
99 fetched first.
101 Use `<branch>` to set `$GIT_DIR/remotes/<name>/HEAD` explicitly. e.g., "git
102 remote set-head origin master" will set `$GIT_DIR/refs/remotes/origin/HEAD` to
103 `refs/remotes/origin/master`. This will only work if
104 `refs/remotes/origin/master` already exists; if not it must be fetched first.
107 'set-url'::
109 Changes URL remote points to. Sets first URL remote points to matching
110 regex <oldurl> (first URL if no <oldurl> is given) to <newurl>. If
111 <oldurl> doesn't match any URL, error occurs and nothing is changed.
113 With '--push', push URLs are manipulated instead of fetch URLs.
115 With '--add', instead of changing some URL, new URL is added.
117 With '--delete', instead of changing some URL, all URLs matching
118 regex <url> are deleted. Trying to delete all non-push URLs is an
119 error.
121 'show'::
123 Gives some information about the remote <name>.
125 With `-n` option, the remote heads are not queried first with
126 `git ls-remote <name>`; cached information is used instead.
128 'prune'::
130 Deletes all stale tracking branches under <name>.
131 These stale branches have already been removed from the remote repository
132 referenced by <name>, but are still locally available in
133 "remotes/<name>".
135 With `--dry-run` option, report what branches will be pruned, but do not
136 actually prune them.
138 'update'::
140 Fetch updates for a named set of remotes in the repository as defined by
141 remotes.<group>.  If a named group is not specified on the command line,
142 the configuration parameter remotes.default will be used; if
143 remotes.default is not defined, all remotes which do not have the
144 configuration parameter remote.<name>.skipDefaultUpdate set to true will
145 be updated.  (See linkgit:git-config[1]).
147 With `--prune` option, prune all the remotes that are updated.
150 DISCUSSION
151 ----------
153 The remote configuration is achieved using the `remote.origin.url` and
154 `remote.origin.fetch` configuration variables.  (See
155 linkgit:git-config[1]).
157 Examples
158 --------
160 * Add a new remote, fetch, and check out a branch from it
162 ------------
163 $ git remote
164 origin
165 $ git branch -r
166 origin/master
167 $ git remote add linux-nfs git://linux-nfs.org/pub/linux/nfs-2.6.git
168 $ git remote
169 linux-nfs
170 origin
171 $ git fetch
172 * refs/remotes/linux-nfs/master: storing branch 'master' ...
173   commit: bf81b46
174 $ git branch -r
175 origin/master
176 linux-nfs/master
177 $ git checkout -b nfs linux-nfs/master
179 ------------
181 * Imitate 'git clone' but track only selected branches
183 ------------
184 $ mkdir project.git
185 $ cd project.git
186 $ git init
187 $ git remote add -f -t master -m master origin git://example.com/git.git/
188 $ git merge origin
189 ------------
192 SEE ALSO
193 --------
194 linkgit:git-fetch[1]
195 linkgit:git-branch[1]
196 linkgit:git-config[1]
198 Author
199 ------
200 Written by Junio Hamano
203 Documentation
204 --------------
205 Documentation by J. Bruce Fields and the git-list <git@vger.kernel.org>.
210 Part of the linkgit:git[1] suite