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