Rework unquote_c_style to work on a strbuf.
[git/dscho.git] / Documentation / git-remote.txt
blob94b9f177724993b800e5d0bd4e67f986bfffc188
1 git-remote(1)
2 ============
4 NAME
5 ----
6 git-remote - manage set of tracked repositories
9 SYNOPSIS
10 --------
11 [verse]
12 'git-remote'
13 'git-remote' add [-t <branch>] [-m <branch>] [-f] [--mirror] <name> <url>
14 'git-remote' show <name>
15 'git-remote' prune <name>
16 'git-remote' update [group]
18 DESCRIPTION
19 -----------
21 Manage the set of repositories ("remotes") whose branches you track.
24 COMMANDS
25 --------
27 With no arguments, shows a list of existing remotes.  Several
28 subcommands are available to perform operations on the remotes.
30 'add'::
32 Adds a remote named <name> for the repository at
33 <url>.  The command `git fetch <name>` can then be used to create and
34 update remote-tracking branches <name>/<branch>.
36 With `-f` option, `git fetch <name>` is run immediately after
37 the remote information is set up.
39 With `-t <branch>` option, instead of the default glob
40 refspec for the remote to track all branches under
41 `$GIT_DIR/remotes/<name>/`, a refspec to track only `<branch>`
42 is created.  You can give more than one `-t <branch>` to track
43 multiple branches without grabbing all branches.
45 With `-m <master>` option, `$GIT_DIR/remotes/<name>/HEAD` is set
46 up to point at remote's `<master>` branch instead of whatever
47 branch the `HEAD` at the remote repository actually points at.
49 In mirror mode, enabled with `--mirror`, the refs will not be stored
50 in the 'refs/remotes/' namespace, but in 'refs/heads/'.  This option
51 only makes sense in bare repositories.
53 'show'::
55 Gives some information about the remote <name>.
57 With `-n` option, the remote heads are not queried first with
58 `git ls-remote <name>`; cached information is used instead.
60 'prune'::
62 Deletes all stale tracking branches under <name>.
63 These stale branches have already been removed from the remote repository
64 referenced by <name>, but are still locally available in
65 "remotes/<name>".
67 With `-n` option, the remote heads are not confirmed first with `git
68 ls-remote <name>`; cached information is used instead.  Use with
69 caution.
71 'update'::
73 Fetch updates for a named set of remotes in the repository as defined by
74 remotes.<group>.  If a named group is not specified on the command line,
75 the configuration parameter remotes.default will get used; if
76 remotes.default is not defined, all remotes which do not the
77 configuration parameter remote.<name>.skipDefaultUpdate set to true will
78 be updated.  (See gitlink:git-config[1]).
81 DISCUSSION
82 ----------
84 The remote configuration is achieved using the `remote.origin.url` and
85 `remote.origin.fetch` configuration variables.  (See
86 gitlink:git-config[1]).
88 Examples
89 --------
91 * Add a new remote, fetch, and check out a branch from it
93 ------------
94 $ git remote
95 origin
96 $ git branch -r
97 origin/master
98 $ git remote add linux-nfs git://linux-nfs.org/pub/nfs-2.6.git
99 $ git remote
100 linux-nfs
101 origin
102 $ git fetch
103 * refs/remotes/linux-nfs/master: storing branch 'master' ...
104   commit: bf81b46
105 $ git branch -r
106 origin/master
107 linux-nfs/master
108 $ git checkout -b nfs linux-nfs/master
110 ------------
112 * Imitate 'git clone' but track only selected branches
114 ------------
115 $ mkdir project.git
116 $ cd project.git
117 $ git init
118 $ git remote add -f -t master -m master origin git://example.com/git.git/
119 $ git merge origin
120 ------------
123 See Also
124 --------
125 gitlink:git-fetch[1]
126 gitlink:git-branch[1]
127 gitlink:git-config[1]
129 Author
130 ------
131 Written by Junio Hamano
134 Documentation
135 --------------
136 Documentation by J. Bruce Fields and the git-list <git@vger.kernel.org>.
141 Part of the gitlink:git[7] suite