|
1 | 1 | GIT URLS[[URLS]]
|
2 | 2 | ----------------
|
3 | 3 |
|
4 |
| -One of the following notations can be used |
5 |
| -to name the remote repository: |
| 4 | +In general, URLs contain information about the transport protocol, the |
| 5 | +address of the remote server, and the path to the repository. |
| 6 | +Depending on the transport protocol, some of this information may be |
| 7 | +absent. |
| 8 | + |
| 9 | +Git natively supports ssh, git, http, https, ftp, ftps, and rsync |
| 10 | +protocols. The following syntaxes may be used with them: |
6 | 11 |
|
7 |
| -- rsync://host.xz/path/to/repo.git/ |
8 |
| -- http://host.xz{startsb}:port{endsb}/path/to/repo.git/ |
9 |
| -- https://host.xz{startsb}:port{endsb}/path/to/repo.git/ |
10 |
| -- git://host.xz{startsb}:port{endsb}/path/to/repo.git/ |
11 |
| -- git://host.xz{startsb}:port{endsb}/~user/path/to/repo.git/ |
12 | 12 | - ssh://{startsb}user@{endsb}host.xz{startsb}:port{endsb}/path/to/repo.git/
|
13 |
| -- 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 |
| 13 | +- git://host.xz{startsb}:port{endsb}/path/to/repo.git/ |
| 14 | +- http{startsb}s{endsb}://host.xz{startsb}:port{endsb}/path/to/repo.git/ |
| 15 | +- ftp{startsb}s{endsb}://host.xz{startsb}:port{endsb}/path/to/repo.git/ |
| 16 | +- rsync://host.xz/path/to/repo.git/ |
16 | 17 |
|
17 |
| -SSH is the default transport protocol over the network. You can |
18 |
| -optionally specify which user to log-in as, and an alternate, |
19 |
| -scp-like syntax is also supported. Both syntaxes support |
20 |
| -username expansion, as does the native git protocol, but |
21 |
| -only the former supports port specification. The following |
22 |
| -three are identical to the last three above, respectively: |
| 18 | +An alternative scp-like syntax may also be used with the ssh protocol: |
23 | 19 |
|
24 |
| -- {startsb}user@{endsb}host.xz:/path/to/repo.git/ |
25 |
| -- {startsb}user@{endsb}host.xz:~user/path/to/repo.git/ |
26 |
| -- {startsb}user@{endsb}host.xz:path/to/repo.git |
| 20 | +- {startsb}user@{endsb}host.xz:path/to/repo.git/ |
27 | 21 |
|
28 |
| -To sync with a local directory, you can use: |
| 22 | +The ssh and git protocols additionally support ~username expansion: |
| 23 | + |
| 24 | +- ssh://{startsb}user@{endsb}host.xz{startsb}:port{endsb}/~{startsb}user{endsb}/path/to/repo.git/ |
| 25 | +- git://host.xz{startsb}:port{endsb}/~{startsb}user{endsb}/path/to/repo.git/ |
| 26 | +- {startsb}user@{endsb}host.xz:/~{startsb}user{endsb}/path/to/repo.git/ |
| 27 | + |
| 28 | +For local respositories, also supported by git natively, the following |
| 29 | +syntaxes may be used: |
29 | 30 |
|
30 | 31 | - /path/to/repo.git/
|
31 | 32 | - file:///path/to/repo.git/
|
32 | 33 |
|
33 | 34 | ifndef::git-clone[]
|
34 |
| -They are mostly equivalent, except when cloning. See |
35 |
| -linkgit:git-clone[1] for details. |
| 35 | +These two syntaxes are mostly equivalent, except when cloning, when |
| 36 | +the former implies --local option. See linkgit:git-clone[1] for |
| 37 | +details. |
36 | 38 | endif::git-clone[]
|
37 | 39 |
|
38 | 40 | ifdef::git-clone[]
|
39 |
| -They are equivalent, except the former implies --local option. |
| 41 | +These two syntaxes are mostly equivalent, except the former implies |
| 42 | +--local option. |
40 | 43 | endif::git-clone[]
|
41 | 44 |
|
| 45 | +When git doesn't know how to handle a certain transport protocol, it |
| 46 | +attempts to use the 'remote-<transport>' remote helper, if one |
| 47 | +exists. To explicitly request a remote helper, the following syntax |
| 48 | +may be used: |
| 49 | + |
| 50 | +- <transport>::<address> |
| 51 | + |
| 52 | +where <address> may be a path, a server and path, or an arbitrary |
| 53 | +URL-like string recognized by the specific remote helper being |
| 54 | +invoked. See linkgit:git-remote-helpers[1] for details. |
42 | 55 |
|
43 | 56 | If there are a large number of similarly-named remote repositories and
|
44 | 57 | you want to use a different format for them (such that the URLs you
|
|
0 commit comments