| 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 | 7ccb9fd | 2006-07-15 01:38:40 | [diff] [blame] | 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 |
| Junio C Hamano | 40f2f8d | 2006-02-07 08:04:39 | [diff] [blame] | 16 | =============================================================== |
| 17 | |
| Junio C Hamano | 7ccb9fd | 2006-07-15 01:38:40 | [diff] [blame] | 18 | SSH is the default transport protocol. You can optionally specify |
| 19 | which user to log-in as, and an alternate, scp-like syntax is also |
| 20 | supported. Both syntaxes support username expansion, |
| Junio C Hamano | 40f2f8d | 2006-02-07 08:04:39 | [diff] [blame] | 21 | as does the native git protocol. The following three are |
| 22 | identical to the last three above, respectively: |
| 23 | |
| 24 | =============================================================== |
| Junio C Hamano | 7ccb9fd | 2006-07-15 01:38:40 | [diff] [blame] | 25 | - {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 Hamano | 40f2f8d | 2006-02-07 08:04:39 | [diff] [blame] | 28 | =============================================================== |
| 29 | |
| 30 | To sync with a local directory, use: |
| 31 | |
| 32 | =============================================================== |
| 33 | - /path/to/repo.git/ |
| 34 | =============================================================== |
| 35 | |
| 36 | REMOTES |
| 37 | ------- |
| 38 | |
| 39 | In addition to the above, as a short-hand, the name of a |
| 40 | file in `$GIT_DIR/remotes` directory can be given; the |
| 41 | named file should be in the following format: |
| 42 | |
| Junio C Hamano | 1caaf47 | 2006-12-31 08:29:35 | [diff] [blame] | 43 | ------------ |
| Junio C Hamano | d3361ad | 2007-01-01 03:20:24 | [diff] [blame] | 44 | URL: one of the above URL format |
| 45 | Push: <refspec> |
| 46 | Pull: <refspec> |
| 47 | |
| Junio C Hamano | 1caaf47 | 2006-12-31 08:29:35 | [diff] [blame] | 48 | ------------ |
| Junio C Hamano | 40f2f8d | 2006-02-07 08:04:39 | [diff] [blame] | 49 | |
| 50 | Then such a short-hand is specified in place of |
| 51 | <repository> without <refspec> parameters on the command |
| 52 | line, <refspec> specified on `Push:` lines or `Pull:` |
| 53 | lines are used for `git-push` and `git-fetch`/`git-pull`, |
| Junio C Hamano | 51c2ab0 | 2006-07-09 20:38:54 | [diff] [blame] | 54 | respectively. Multiple `Push:` and `Pull:` lines may |
| Junio C Hamano | 40f2f8d | 2006-02-07 08:04:39 | [diff] [blame] | 55 | be specified for additional branch mappings. |
| 56 | |
| Junio C Hamano | 249572f | 2006-10-24 05:44:08 | [diff] [blame] | 57 | Or, equivalently, in the `$GIT_DIR/config` (note the use |
| 58 | of `fetch` instead of `Pull:`): |
| 59 | |
| Junio C Hamano | 1caaf47 | 2006-12-31 08:29:35 | [diff] [blame] | 60 | ------------ |
| Junio C Hamano | d3361ad | 2007-01-01 03:20:24 | [diff] [blame] | 61 | [remote "<remote>"] |
| 62 | url = <url> |
| 63 | push = <refspec> |
| 64 | fetch = <refspec> |
| 65 | |
| Junio C Hamano | 1caaf47 | 2006-12-31 08:29:35 | [diff] [blame] | 66 | ------------ |
| Junio C Hamano | 249572f | 2006-10-24 05:44:08 | [diff] [blame] | 67 | |
| Junio C Hamano | 40f2f8d | 2006-02-07 08:04:39 | [diff] [blame] | 68 | The name of a file in `$GIT_DIR/branches` directory can be |
| 69 | specified as an older notation short-hand; the named |
| 70 | file should contain a single line, a URL in one of the |
| 71 | above formats, optionally followed by a hash `#` and the |
| 72 | name of remote head (URL fragment notation). |
| 73 | `$GIT_DIR/branches/<remote>` file that stores a <url> |
| 74 | without the fragment is equivalent to have this in the |
| 75 | corresponding file in the `$GIT_DIR/remotes/` directory. |
| 76 | |
| Junio C Hamano | 1caaf47 | 2006-12-31 08:29:35 | [diff] [blame] | 77 | ------------ |
| Junio C Hamano | d3361ad | 2007-01-01 03:20:24 | [diff] [blame] | 78 | URL: <url> |
| 79 | Pull: refs/heads/master:<remote> |
| Junio C Hamano | 1caaf47 | 2006-12-31 08:29:35 | [diff] [blame] | 80 | |
| Junio C Hamano | d3361ad | 2007-01-01 03:20:24 | [diff] [blame] | 81 | ------------ |
| Junio C Hamano | 40f2f8d | 2006-02-07 08:04:39 | [diff] [blame] | 82 | |
| 83 | while having `<url>#<head>` is equivalent to |
| 84 | |
| Junio C Hamano | 1caaf47 | 2006-12-31 08:29:35 | [diff] [blame] | 85 | ------------ |
| Junio C Hamano | d3361ad | 2007-01-01 03:20:24 | [diff] [blame] | 86 | URL: <url> |
| 87 | Pull: refs/heads/<head>:<remote> |
| Junio C Hamano | 1caaf47 | 2006-12-31 08:29:35 | [diff] [blame] | 88 | ------------ |