blob: 61a6022ce8a0fc7aac8b1e9bd08587817ef0d69c [file] [log] [blame]
Junio C Hamano1d3a6c72007-01-09 11:13:471git-remote(1)
2============
3
4NAME
5----
6git-remote - manage set of tracked repositories
7
8
9SYNOPSIS
10--------
11[verse]
12'git-remote'
Junio C Hamano6ac2f142007-03-01 01:24:5613'git-remote' add [-t <branch>] [-m <branch>] [-f] <name> <url>
Junio C Hamano1d3a6c72007-01-09 11:13:4714'git-remote' show <name>
Junio C Hamano39381a72007-02-02 07:35:1515'git-remote' prune <name>
Junio C Hamano118d2772007-02-21 20:24:1016'git-remote' update [group]
Junio C Hamano1d3a6c72007-01-09 11:13:4717
18DESCRIPTION
19-----------
20
21Manage the set of repositories ("remotes") whose branches you track.
22
Junio C Hamano1d3a6c72007-01-09 11:13:4723
Junio C Hamanoee1e4282007-02-04 08:32:0424COMMANDS
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
Junio C Hamano1d3a6c72007-01-09 11:13:4733<url>. The command `git fetch <name>` can then be used to create and
34update remote-tracking branches <name>/<branch>.
Junio C Hamano17dde0e2007-02-26 09:50:2135+
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
Junio C Hamano67fad6d2007-05-06 08:53:1243multiple branches without grabbing all branches.
Junio C Hamano17dde0e2007-02-26 09:50:2144+
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.
Junio C Hamano1d3a6c72007-01-09 11:13:4748
Junio C Hamanoee1e4282007-02-04 08:32:0449'show'::
Junio C Hamano1d3a6c72007-01-09 11:13:4750
Junio C Hamanoee1e4282007-02-04 08:32:0451Gives some information about the remote <name>.
Junio C Hamano401939f2007-07-01 06:34:3052+
53With `-n` option, the remote heads are not queried first with
54`git ls-remote <name>`; cached information is used instead.
Junio C Hamanoee1e4282007-02-04 08:32:0455
56'prune'::
57
58Deletes all stale tracking branches under <name>.
Junio C Hamano39381a72007-02-02 07:35:1559These stale branches have already been removed from the remote repository
Junio C Hamano0bbd4672007-02-20 04:52:1460referenced by <name>, but are still locally available in
61"remotes/<name>".
Junio C Hamano401939f2007-07-01 06:34:3062+
63With `-n` option, the remote heads are not confirmed first with `git
64ls-remote <name>`; cached information is used instead. Use with
65caution.
Junio C Hamano0bbd4672007-02-20 04:52:1466
67'update'::
68
Junio C Hamano118d2772007-02-21 20:24:1069Fetch updates for a named set of remotes in the repository as defined by
70remotes.<group>. If a named group is not specified on the command line,
71the configuration parameter remotes.default will get used; if
72remotes.default is not defined, all remotes which do not the
73configuration parameter remote.<name>.skipDefaultUpdate set to true will
74be updated. (See gitlink:git-config[1]).
Junio C Hamano39381a72007-02-02 07:35:1575
Junio C Hamanoee1e4282007-02-04 08:32:0476
77DISCUSSION
78----------
79
Junio C Hamano1d3a6c72007-01-09 11:13:4780The remote configuration is achieved using the `remote.origin.url` and
81`remote.origin.fetch` configuration variables. (See
Junio C Hamano7ad22dc2007-01-29 02:55:4882gitlink:git-config[1]).
Junio C Hamano1d3a6c72007-01-09 11:13:4783
84Examples
85--------
86
Junio C Hamano6ac2f142007-03-01 01:24:5687* Add a new remote, fetch, and check out a branch from it
88+
Junio C Hamano1d3a6c72007-01-09 11:13:4789------------
90$ git remote
91origin
92$ git branch -r
93origin/master
94$ git remote add linux-nfs git://linux-nfs.org/pub/nfs-2.6.git
95$ git remote
96linux-nfs
97origin
98$ git fetch
99* refs/remotes/linux-nfs/master: storing branch 'master' ...
100 commit: bf81b46
101$ git branch -r
102origin/master
103linux-nfs/master
104$ git checkout -b nfs linux-nfs/master
105...
106------------
107
Junio C Hamano6ac2f142007-03-01 01:24:56108* Imitate 'git clone' but track only selected branches
109+
110------------
111$ mkdir project.git
112$ cd project.git
113$ git init
114$ git remote add -f -t master -m master origin git://example.com/git.git/
115$ git merge origin
116------------
117
118
Junio C Hamano1d3a6c72007-01-09 11:13:47119See Also
120--------
121gitlink:git-fetch[1]
122gitlink:git-branch[1]
Junio C Hamano7ad22dc2007-01-29 02:55:48123gitlink:git-config[1]
Junio C Hamano1d3a6c72007-01-09 11:13:47124
125Author
126------
127Written by Junio Hamano
128
129
130Documentation
131--------------
132Documentation by J. Bruce Fields and the git-list <git@vger.kernel.org>.
133
134
135GIT
136---
137Part of the gitlink:git[7] suite