Update draft release notes to 1.8.2.1
[git/mingw.git] / Documentation / urls.txt
blob3ca122faedd01cfbd61bf07dbc245b04f40f2b23
1 GIT URLS[[URLS]]
2 ----------------
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.
9 Git supports ssh, git, http, and https protocols (in addition, ftp,
10 and ftps can be used for fetching and rsync can be used for fetching
11 and pushing, but these are inefficient and deprecated; do not use
12 them).
14 The following syntaxes may be used with them:
16 - ssh://{startsb}user@{endsb}host.xz{startsb}:port{endsb}/path/to/repo.git/
17 - git://host.xz{startsb}:port{endsb}/path/to/repo.git/
18 - http{startsb}s{endsb}://host.xz{startsb}:port{endsb}/path/to/repo.git/
19 - ftp{startsb}s{endsb}://host.xz{startsb}:port{endsb}/path/to/repo.git/
20 - rsync://host.xz/path/to/repo.git/
22 An alternative scp-like syntax may also be used with the ssh protocol:
24 - {startsb}user@{endsb}host.xz:path/to/repo.git/
26 The ssh and git protocols additionally support ~username expansion:
28 - ssh://{startsb}user@{endsb}host.xz{startsb}:port{endsb}/~{startsb}user{endsb}/path/to/repo.git/
29 - git://host.xz{startsb}:port{endsb}/~{startsb}user{endsb}/path/to/repo.git/
30 - {startsb}user@{endsb}host.xz:/~{startsb}user{endsb}/path/to/repo.git/
32 For local repositories, also supported by Git natively, the following
33 syntaxes may be used:
35 - /path/to/repo.git/
36 - file:///path/to/repo.git/
38 ifndef::git-clone[]
39 These two syntaxes are mostly equivalent, except when cloning, when
40 the former implies --local option. See linkgit:git-clone[1] for
41 details.
42 endif::git-clone[]
44 ifdef::git-clone[]
45 These two syntaxes are mostly equivalent, except the former implies
46 --local option.
47 endif::git-clone[]
49 When Git doesn't know how to handle a certain transport protocol, it
50 attempts to use the 'remote-<transport>' remote helper, if one
51 exists. To explicitly request a remote helper, the following syntax
52 may be used:
54 - <transport>::<address>
56 where <address> may be a path, a server and path, or an arbitrary
57 URL-like string recognized by the specific remote helper being
58 invoked. See linkgit:gitremote-helpers[1] for details.
60 If there are a large number of similarly-named remote repositories and
61 you want to use a different format for them (such that the URLs you
62 use will be rewritten into URLs that work), you can create a
63 configuration section of the form:
65 ------------
66         [url "<actual url base>"]
67                 insteadOf = <other url base>
68 ------------
70 For example, with this:
72 ------------
73         [url "git://git.host.xz/"]
74                 insteadOf = host.xz:/path/to/
75                 insteadOf = work:
76 ------------
78 a URL like "work:repo.git" or like "host.xz:/path/to/repo.git" will be
79 rewritten in any context that takes a URL to be "git://git.host.xz/repo.git".
81 If you want to rewrite URLs for push only, you can create a
82 configuration section of the form:
84 ------------
85         [url "<actual url base>"]
86                 pushInsteadOf = <other url base>
87 ------------
89 For example, with this:
91 ------------
92         [url "ssh://example.org/"]
93                 pushInsteadOf = git://example.org/
94 ------------
96 a URL like "git://example.org/path/to/repo.git" will be rewritten to
97 "ssh://example.org/path/to/repo.git" for pushes, but pulls will still
98 use the original URL.