]> git.ipfire.org Git - thirdparty/git.git/blame - Documentation/git-remote.txt
repack: improve documentation on -a option
[thirdparty/git.git] / Documentation / git-remote.txt
CommitLineData
041e69c9
BF
1git-remote(1)
2============
3
4NAME
5----
6git-remote - manage set of tracked repositories
7
8
9SYNOPSIS
10--------
11[verse]
12'git-remote'
db554bf0 13'git-remote' add [-t <branch>] [-m <branch>] [-f] <name> <url>
041e69c9 14'git-remote' show <name>
859607df 15'git-remote' prune <name>
1918278e 16'git-remote' update [group]
041e69c9
BF
17
18DESCRIPTION
19-----------
20
21Manage the set of repositories ("remotes") whose branches you track.
22
041e69c9 23
0f390875
SP
24COMMANDS
25--------
26
27With no arguments, shows a list of existing remotes. Several
28subcommands are available to perform operations on the remotes.
29
30'add'::
31
32Adds a remote named <name> for the repository at
041e69c9
BF
33<url>. The command `git fetch <name>` can then be used to create and
34update remote-tracking branches <name>/<branch>.
c5ddca1f
JH
35+
36With `-f` option, `git fetch <name>` is run immediately after
37the remote information is set up.
38+
39With `-t <branch>` option, instead of the default glob
40refspec for the remote to track all branches under
41`$GIT_DIR/remotes/<name>/`, a refspec to track only `<branch>`
42is created. You can give more than one `-t <branch>` to track
cf593cc4 43multiple branches without grabbing all branches.
c5ddca1f
JH
44+
45With `-m <master>` option, `$GIT_DIR/remotes/<name>/HEAD` is set
46up to point at remote's `<master>` branch instead of whatever
47branch the `HEAD` at the remote repository actually points at.
041e69c9 48
0f390875 49'show'::
041e69c9 50
0f390875
SP
51Gives some information about the remote <name>.
52
53'prune'::
54
55Deletes all stale tracking branches under <name>.
859607df 56These stale branches have already been removed from the remote repository
1e592d65
TT
57referenced by <name>, but are still locally available in
58"remotes/<name>".
59
60'update'::
61
1918278e
TT
62Fetch updates for a named set of remotes in the repository as defined by
63remotes.<group>. If a named group is not specified on the command line,
64the configuration parameter remotes.default will get used; if
65remotes.default is not defined, all remotes which do not the
66configuration parameter remote.<name>.skipDefaultUpdate set to true will
67be updated. (See gitlink:git-config[1]).
859607df 68
0f390875
SP
69
70DISCUSSION
71----------
72
041e69c9
BF
73The remote configuration is achieved using the `remote.origin.url` and
74`remote.origin.fetch` configuration variables. (See
e0d10e1c 75gitlink:git-config[1]).
041e69c9
BF
76
77Examples
78--------
79
db554bf0
JH
80* Add a new remote, fetch, and check out a branch from it
81+
041e69c9
BF
82------------
83$ git remote
84origin
85$ git branch -r
86origin/master
87$ git remote add linux-nfs git://linux-nfs.org/pub/nfs-2.6.git
88$ git remote
89linux-nfs
90origin
91$ git fetch
92* refs/remotes/linux-nfs/master: storing branch 'master' ...
93 commit: bf81b46
94$ git branch -r
95origin/master
96linux-nfs/master
97$ git checkout -b nfs linux-nfs/master
98...
99------------
100
db554bf0
JH
101* Imitate 'git clone' but track only selected branches
102+
103------------
104$ mkdir project.git
105$ cd project.git
106$ git init
107$ git remote add -f -t master -m master origin git://example.com/git.git/
108$ git merge origin
109------------
110
111
041e69c9
BF
112See Also
113--------
114gitlink:git-fetch[1]
115gitlink:git-branch[1]
e0d10e1c 116gitlink:git-config[1]
041e69c9
BF
117
118Author
119------
120Written by Junio Hamano
121
122
123Documentation
124--------------
125Documentation by J. Bruce Fields and the git-list <git@vger.kernel.org>.
126
127
128GIT
129---
130Part of the gitlink:git[7] suite
131