Documentation: describe "-f/-t/-m" options to "git-remote add"
[git/gitweb.git] / Documentation / git-remote.txt
bloba2ff8f098ebff138751a3559fee54019584e096a
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 <name> <url>
14 'git-remote' show <name>
15 'git-remote' prune <name>
17 DESCRIPTION
18 -----------
20 Manage the set of repositories ("remotes") whose branches you track.
23 COMMANDS
24 --------
26 With no arguments, shows a list of existing remotes.  Several
27 subcommands are available to perform operations on the remotes.
29 'add'::
31 Adds a remote named <name> for the repository at
32 <url>.  The command `git fetch <name>` can then be used to create and
33 update remote-tracking branches <name>/<branch>.
35 With `-f` option, `git fetch <name>` is run immediately after
36 the remote information is set up.
38 With `-t <branch>` option, instead of the default glob
39 refspec for the remote to track all branches under
40 `$GIT_DIR/remotes/<name>/`, a refspec to track only `<branch>`
41 is created.  You can give more than one `-t <branch>` to track
42 multiple branche without grabbing all branches.
44 With `-m <master>` option, `$GIT_DIR/remotes/<name>/HEAD` is set
45 up to point at remote's `<master>` branch instead of whatever
46 branch the `HEAD` at the remote repository actually points at.
48 'show'::
50 Gives some information about the remote <name>.
52 'prune'::
54 Deletes all stale tracking branches under <name>.
55 These stale branches have already been removed from the remote repository
56 referenced by <name>, but are still locally available in "remotes/<name>".
59 DISCUSSION
60 ----------
62 The remote configuration is achieved using the `remote.origin.url` and
63 `remote.origin.fetch` configuration variables.  (See
64 gitlink:git-config[1]).
66 Examples
67 --------
69 Add a new remote, fetch, and check out a branch from it:
71 ------------
72 $ git remote
73 origin
74 $ git branch -r
75 origin/master
76 $ git remote add linux-nfs git://linux-nfs.org/pub/nfs-2.6.git
77 $ git remote
78 linux-nfs
79 origin
80 $ git fetch
81 * refs/remotes/linux-nfs/master: storing branch 'master' ...
82   commit: bf81b46
83 $ git branch -r
84 origin/master
85 linux-nfs/master
86 $ git checkout -b nfs linux-nfs/master
87 ...
88 ------------
90 See Also
91 --------
92 gitlink:git-fetch[1]
93 gitlink:git-branch[1]
94 gitlink:git-config[1]
96 Author
97 ------
98 Written by Junio Hamano
101 Documentation
102 --------------
103 Documentation by J. Bruce Fields and the git-list <git@vger.kernel.org>.
108 Part of the gitlink:git[7] suite