Documentation / git-remote.txton commit Use capitalized names where appropriate (c7719fb)
   1git-remote(1)
   2============
   3
   4NAME
   5----
   6git-remote - manage set of tracked repositories
   7
   8
   9SYNOPSIS
  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 show' [-n] <name>
  17'git remote prune' [-n | --dry-run] <name>
  18'git remote update' [group]
  19
  20DESCRIPTION
  21-----------
  22
  23Manage the set of repositories ("remotes") whose branches you track.
  24
  25
  26OPTIONS
  27-------
  28
  29-v::
  30--verbose::
  31        Be a little more verbose and show remote url after name.
  32
  33
  34COMMANDS
  35--------
  36
  37With no arguments, shows a list of existing remotes.  Several
  38subcommands are available to perform operations on the remotes.
  39
  40'add'::
  41
  42Adds a remote named <name> for the repository at
  43<url>.  The command `git fetch <name>` can then be used to create and
  44update remote-tracking branches <name>/<branch>.
  45+
  46With `-f` option, `git fetch <name>` is run immediately after
  47the remote information is set up.
  48+
  49With `-t <branch>` option, instead of the default glob
  50refspec for the remote to track all branches under
  51`$GIT_DIR/remotes/<name>/`, a refspec to track only `<branch>`
  52is created.  You can give more than one `-t <branch>` to track
  53multiple branches without grabbing all branches.
  54+
  55With `-m <master>` option, `$GIT_DIR/remotes/<name>/HEAD` is set
  56up to point at remote's `<master>` branch instead of whatever
  57branch the `HEAD` at the remote repository actually points at.
  58+
  59In mirror mode, enabled with `\--mirror`, the refs will not be stored
  60in the 'refs/remotes/' namespace, but in 'refs/heads/'.  This option
  61only makes sense in bare repositories.  If a remote uses mirror
  62mode, furthermore, `git push` will always behave as if `\--mirror`
  63was passed.
  64
  65'rename'::
  66
  67Rename the remote named <old> to <new>. All remote tracking branches and
  68configuration settings for the remote are updated.
  69+
  70In case <old> and <new> are the same, and <old> is a file under
  71`$GIT_DIR/remotes` or `$GIT_DIR/branches`, the remote is converted to
  72the configuration file format.
  73
  74'rm'::
  75
  76Remove the remote named <name>. All remote tracking branches and
  77configuration settings for the remote are removed.
  78
  79'show'::
  80
  81Gives some information about the remote <name>.
  82+
  83With `-n` option, the remote heads are not queried first with
  84`git ls-remote <name>`; cached information is used instead.
  85
  86'prune'::
  87
  88Deletes all stale tracking branches under <name>.
  89These stale branches have already been removed from the remote repository
  90referenced by <name>, but are still locally available in
  91"remotes/<name>".
  92+
  93With `--dry-run` option, report what branches will be pruned, but do no
  94actually prune them.
  95
  96'update'::
  97
  98Fetch updates for a named set of remotes in the repository as defined by
  99remotes.<group>.  If a named group is not specified on the command line,
 100the configuration parameter remotes.default will get used; if
 101remotes.default is not defined, all remotes which do not have the
 102configuration parameter remote.<name>.skipDefaultUpdate set to true will
 103be updated.  (See linkgit:git-config[1]).
 104
 105
 106DISCUSSION
 107----------
 108
 109The remote configuration is achieved using the `remote.origin.url` and
 110`remote.origin.fetch` configuration variables.  (See
 111linkgit:git-config[1]).
 112
 113Examples
 114--------
 115
 116* Add a new remote, fetch, and check out a branch from it
 117+
 118------------
 119$ git remote
 120origin
 121$ git branch -r
 122origin/master
 123$ git remote add linux-nfs git://linux-nfs.org/pub/linux/nfs-2.6.git
 124$ git remote
 125linux-nfs
 126origin
 127$ git fetch
 128* refs/remotes/linux-nfs/master: storing branch 'master' ...
 129  commit: bf81b46
 130$ git branch -r
 131origin/master
 132linux-nfs/master
 133$ git checkout -b nfs linux-nfs/master
 134...
 135------------
 136
 137* Imitate 'git-clone' but track only selected branches
 138+
 139------------
 140$ mkdir project.git
 141$ cd project.git
 142$ git init
 143$ git remote add -f -t master -m master origin git://example.com/git.git/
 144$ git merge origin
 145------------
 146
 147
 148SEE ALSO
 149--------
 150linkgit:git-fetch[1]
 151linkgit:git-branch[1]
 152linkgit:git-config[1]
 153
 154Author
 155------
 156Written by Junio Hamano
 157
 158
 159Documentation
 160--------------
 161Documentation by J. Bruce Fields and the git-list <git@vger.kernel.org>.
 162
 163
 164GIT
 165---
 166Part of the linkgit:git[1] suite