blob: fa34c6747194aaecf9e8124462129b8bbc9ae7d4 [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 Hamanodbb64592007-09-01 11:17:3913- ssh://{startsb}user@{endsb}host.xz{startsb}:port{endsb}/path/to/repo.git/
Junio C Hamano7ccb9fd2006-07-15 01:38:4014- 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 Hamano40f2f8d2006-02-07 08:04:3917===============================================================
18
Junio C Hamanob1d6e882007-08-11 08:30:1619SSH is the default transport protocol over the network. You can
20optionally specify which user to log-in as, and an alternate,
21scp-like syntax is also supported. Both syntaxes support
Junio C Hamanodbb64592007-09-01 11:17:3922username expansion, as does the native git protocol, but
23only the former supports port specification. The following
Junio C Hamanob1d6e882007-08-11 08:30:1624three are identical to the last three above, respectively:
Junio C Hamano40f2f8d2006-02-07 08:04:3925
26===============================================================
Junio C Hamano7ccb9fd2006-07-15 01:38:4027- {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 Hamano40f2f8d2006-02-07 08:04:3930===============================================================
31
Junio C Hamanob1d6e882007-08-11 08:30:1632To sync with a local directory, you can use:
Junio C Hamano40f2f8d2006-02-07 08:04:3933
34===============================================================
35- /path/to/repo.git/
Junio C Hamanob1d6e882007-08-11 08:30:1636- file:///path/to/repo.git/
Junio C Hamano40f2f8d2006-02-07 08:04:3937===============================================================
Junio C Hamanob1d6e882007-08-11 08:30:1638
Junio C Hamano63777e22007-11-17 20:52:1639ifndef::git-clone[]
Junio C Hamanob1d6e882007-08-11 08:30:1640They are mostly equivalent, except when cloning. See
Junio C Hamano35738e82008-01-07 07:55:4641linkgit:git-clone[1] for details.
Junio C Hamano63777e22007-11-17 20:52:1642endif::git-clone[]
43
44ifdef::git-clone[]
45They are equivalent, except the former implies --local option.
46endif::git-clone[]
Junio C Hamano24bc09a2008-02-28 00:27:4447
48
49If there are a large number of similarly-named remote repositories and
50you want to use a different format for them (such that the URLs you
51use will be rewritten into URLs that work), you can create a
52configuration section of the form:
53
54------------
55[url "<actual url base>"]
56insteadOf = <other url base>
57------------
58
59For example, with this:
60
61------------
62[url "git://git.host.xz/"]
63insteadOf = host.xz:/path/to/
64insteadOf = work:
65------------
66
67a URL like "work:repo.git" or like "host.xz:/path/to/repo.git" will be
68rewritten in any context that takes a URL to be "git://git.host.xz/repo.git".
69