| Junio C Hamano | 40f2f8d | 2006-02-07 08:04:39 | [diff] [blame] | 1 | GIT URLS[[URLS]] |
| 2 | ---------------- |
| 3 | |
| 4 | One of the following notations can be used |
| 5 | to 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 Hamano | dbb6459 | 2007-09-01 11:17:39 | [diff] [blame] | 13 | - ssh://{startsb}user@{endsb}host.xz{startsb}:port{endsb}/path/to/repo.git/ |
| Junio C Hamano | 7ccb9fd | 2006-07-15 01:38:40 | [diff] [blame] | 14 | - ssh://{startsb}user@{endsb}host.xz/path/to/repo.git/ |
| 15 | - ssh://{startsb}user@{endsb}host.xz/~user/path/to/repo.git/ |
| 16 | - ssh://{startsb}user@{endsb}host.xz/~/path/to/repo.git |
| Junio C Hamano | 40f2f8d | 2006-02-07 08:04:39 | [diff] [blame] | 17 | =============================================================== |
| 18 | |
| Junio C Hamano | b1d6e88 | 2007-08-11 08:30:16 | [diff] [blame] | 19 | SSH is the default transport protocol over the network. You can |
| 20 | optionally specify which user to log-in as, and an alternate, |
| 21 | scp-like syntax is also supported. Both syntaxes support |
| Junio C Hamano | dbb6459 | 2007-09-01 11:17:39 | [diff] [blame] | 22 | username expansion, as does the native git protocol, but |
| 23 | only the former supports port specification. The following |
| Junio C Hamano | b1d6e88 | 2007-08-11 08:30:16 | [diff] [blame] | 24 | three are identical to the last three above, respectively: |
| Junio C Hamano | 40f2f8d | 2006-02-07 08:04:39 | [diff] [blame] | 25 | |
| 26 | =============================================================== |
| Junio C Hamano | 7ccb9fd | 2006-07-15 01:38:40 | [diff] [blame] | 27 | - {startsb}user@{endsb}host.xz:/path/to/repo.git/ |
| 28 | - {startsb}user@{endsb}host.xz:~user/path/to/repo.git/ |
| 29 | - {startsb}user@{endsb}host.xz:path/to/repo.git |
| Junio C Hamano | 40f2f8d | 2006-02-07 08:04:39 | [diff] [blame] | 30 | =============================================================== |
| 31 | |
| Junio C Hamano | b1d6e88 | 2007-08-11 08:30:16 | [diff] [blame] | 32 | To sync with a local directory, you can use: |
| Junio C Hamano | 40f2f8d | 2006-02-07 08:04:39 | [diff] [blame] | 33 | |
| 34 | =============================================================== |
| 35 | - /path/to/repo.git/ |
| Junio C Hamano | b1d6e88 | 2007-08-11 08:30:16 | [diff] [blame] | 36 | - file:///path/to/repo.git/ |
| Junio C Hamano | 40f2f8d | 2006-02-07 08:04:39 | [diff] [blame] | 37 | =============================================================== |
| Junio C Hamano | b1d6e88 | 2007-08-11 08:30:16 | [diff] [blame] | 38 | |
| Junio C Hamano | 63777e2 | 2007-11-17 20:52:16 | [diff] [blame] | 39 | ifndef::git-clone[] |
| Junio C Hamano | b1d6e88 | 2007-08-11 08:30:16 | [diff] [blame] | 40 | They are mostly equivalent, except when cloning. See |
| Junio C Hamano | 35738e8 | 2008-01-07 07:55:46 | [diff] [blame] | 41 | linkgit:git-clone[1] for details. |
| Junio C Hamano | 63777e2 | 2007-11-17 20:52:16 | [diff] [blame] | 42 | endif::git-clone[] |
| 43 | |
| 44 | ifdef::git-clone[] |
| 45 | They are equivalent, except the former implies --local option. |
| 46 | endif::git-clone[] |
| Junio C Hamano | 24bc09a | 2008-02-28 00:27:44 | [diff] [blame] | 47 | |
| 48 | |
| 49 | If there are a large number of similarly-named remote repositories and |
| 50 | you want to use a different format for them (such that the URLs you |
| 51 | use will be rewritten into URLs that work), you can create a |
| 52 | configuration section of the form: |
| 53 | |
| 54 | ------------ |
| 55 | [url "<actual url base>"] |
| 56 | insteadOf = <other url base> |
| 57 | ------------ |
| 58 | |
| 59 | For example, with this: |
| 60 | |
| 61 | ------------ |
| 62 | [url "git://git.host.xz/"] |
| 63 | insteadOf = host.xz:/path/to/ |
| 64 | insteadOf = work: |
| 65 | ------------ |
| 66 | |
| 67 | a URL like "work:repo.git" or like "host.xz:/path/to/repo.git" will be |
| 68 | rewritten in any context that takes a URL to be "git://git.host.xz/repo.git". |
| 69 | |