blob: 745f9677d005b522f52496339abd5afc4267a815 [file] [log] [blame]
Junio C Hamano40f2f8d2006-02-07 08:04:391GIT URLS[[URLS]]
2----------------
3
4One of the following notations can be used
5to name the remote repository:
6
7===============================================================
8- rsync://host.xz/path/to/repo.git/
9- http://host.xz/path/to/repo.git/
10- https://host.xz/path/to/repo.git/
11- git://host.xz/path/to/repo.git/
12- git://host.xz/~user/path/to/repo.git/
Junio C Hamano7ccb9fd2006-07-15 01:38:4013- ssh://{startsb}user@{endsb}host.xz/path/to/repo.git/
14- ssh://{startsb}user@{endsb}host.xz/~user/path/to/repo.git/
15- ssh://{startsb}user@{endsb}host.xz/~/path/to/repo.git
Junio C Hamano40f2f8d2006-02-07 08:04:3916===============================================================
17
Junio C Hamano7ccb9fd2006-07-15 01:38:4018SSH is the default transport protocol. You can optionally specify
19which user to log-in as, and an alternate, scp-like syntax is also
20supported. Both syntaxes support username expansion,
Junio C Hamano40f2f8d2006-02-07 08:04:3921as does the native git protocol. The following three are
22identical to the last three above, respectively:
23
24===============================================================
Junio C Hamano7ccb9fd2006-07-15 01:38:4025- {startsb}user@{endsb}host.xz:/path/to/repo.git/
26- {startsb}user@{endsb}host.xz:~user/path/to/repo.git/
27- {startsb}user@{endsb}host.xz:path/to/repo.git
Junio C Hamano40f2f8d2006-02-07 08:04:3928===============================================================
29
30To sync with a local directory, use:
31
32===============================================================
33- /path/to/repo.git/
34===============================================================
35
36REMOTES
37-------
38
39In addition to the above, as a short-hand, the name of a
40file in `$GIT_DIR/remotes` directory can be given; the
41named file should be in the following format:
42
Junio C Hamano1caaf472006-12-31 08:29:3543------------
Junio C Hamanod3361ad2007-01-01 03:20:2444URL: one of the above URL format
45Push: <refspec>
46Pull: <refspec>
47
Junio C Hamano1caaf472006-12-31 08:29:3548------------
Junio C Hamano40f2f8d2006-02-07 08:04:3949
50Then such a short-hand is specified in place of
51<repository> without <refspec> parameters on the command
52line, <refspec> specified on `Push:` lines or `Pull:`
53lines are used for `git-push` and `git-fetch`/`git-pull`,
Junio C Hamano51c2ab02006-07-09 20:38:5454respectively. Multiple `Push:` and `Pull:` lines may
Junio C Hamano40f2f8d2006-02-07 08:04:3955be specified for additional branch mappings.
56
Junio C Hamano249572f2006-10-24 05:44:0857Or, equivalently, in the `$GIT_DIR/config` (note the use
58of `fetch` instead of `Pull:`):
59
Junio C Hamano1caaf472006-12-31 08:29:3560------------
Junio C Hamanod3361ad2007-01-01 03:20:2461[remote "<remote>"]
62url = <url>
63push = <refspec>
64fetch = <refspec>
65
Junio C Hamano1caaf472006-12-31 08:29:3566------------
Junio C Hamano249572f2006-10-24 05:44:0867
Junio C Hamano40f2f8d2006-02-07 08:04:3968The name of a file in `$GIT_DIR/branches` directory can be
69specified as an older notation short-hand; the named
70file should contain a single line, a URL in one of the
71above formats, optionally followed by a hash `#` and the
72name of remote head (URL fragment notation).
73`$GIT_DIR/branches/<remote>` file that stores a <url>
74without the fragment is equivalent to have this in the
75corresponding file in the `$GIT_DIR/remotes/` directory.
76
Junio C Hamano1caaf472006-12-31 08:29:3577------------
Junio C Hamanod3361ad2007-01-01 03:20:2478URL: <url>
79Pull: refs/heads/master:<remote>
Junio C Hamano1caaf472006-12-31 08:29:3580
Junio C Hamanod3361ad2007-01-01 03:20:2481------------
Junio C Hamano40f2f8d2006-02-07 08:04:3982
83while having `<url>#<head>` is equivalent to
84
Junio C Hamano1caaf472006-12-31 08:29:3585------------
Junio C Hamanod3361ad2007-01-01 03:20:2486URL: <url>
87Pull: refs/heads/<head>:<remote>
Junio C Hamano1caaf472006-12-31 08:29:3588------------