]> git.ipfire.org Git - thirdparty/git.git/blame - Documentation/urls.txt
Merge git://git.bogomips.org/git-svn
[thirdparty/git.git] / Documentation / urls.txt
CommitLineData
85a97d4e
BF
1GIT URLS[[URLS]]
2----------------
3
5ce4f4e3
RR
4In general, URLs contain information about the transport protocol, the
5address of the remote server, and the path to the repository.
6Depending on the transport protocol, some of this information may be
7absent.
8
9Git natively supports ssh, git, http, https, ftp, ftps, and rsync
10protocols. The following syntaxes may be used with them:
85a97d4e 11
2e776665 12- ssh://{startsb}user@{endsb}host.xz{startsb}:port{endsb}/path/to/repo.git/
5ce4f4e3
RR
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/
85a97d4e 17
5ce4f4e3 18An alternative scp-like syntax may also be used with the ssh protocol:
85a97d4e 19
5ce4f4e3 20- {startsb}user@{endsb}host.xz:path/to/repo.git/
85a97d4e 21
5ce4f4e3
RR
22The 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
6b677a28 28For local repositories, also supported by git natively, the following
5ce4f4e3 29syntaxes may be used:
85a97d4e 30
3598a308 31- /path/to/repo.git/
3d5c418f 32- file:///path/to/repo.git/
3d5c418f 33
347989f4 34ifndef::git-clone[]
5ce4f4e3
RR
35These two syntaxes are mostly equivalent, except when cloning, when
36the former implies --local option. See linkgit:git-clone[1] for
37details.
347989f4
SO
38endif::git-clone[]
39
40ifdef::git-clone[]
5ce4f4e3
RR
41These two syntaxes are mostly equivalent, except the former implies
42--local option.
347989f4 43endif::git-clone[]
55029ae4 44
5ce4f4e3
RR
45When git doesn't know how to handle a certain transport protocol, it
46attempts to use the 'remote-<transport>' remote helper, if one
47exists. To explicitly request a remote helper, the following syntax
48may be used:
49
50- <transport>::<address>
51
52where <address> may be a path, a server and path, or an arbitrary
53URL-like string recognized by the specific remote helper being
54invoked. See linkgit:git-remote-helpers[1] for details.
55029ae4
DB
55
56If there are a large number of similarly-named remote repositories and
57you want to use a different format for them (such that the URLs you
58use will be rewritten into URLs that work), you can create a
59configuration section of the form:
60
61------------
62 [url "<actual url base>"]
63 insteadOf = <other url base>
64------------
65
66For example, with this:
67
68------------
69 [url "git://git.host.xz/"]
70 insteadOf = host.xz:/path/to/
71 insteadOf = work:
72------------
73
74a URL like "work:repo.git" or like "host.xz:/path/to/repo.git" will be
75rewritten in any context that takes a URL to be "git://git.host.xz/repo.git".
76
1c2eafb8
JT
77If you want to rewrite URLs for push only, you can create a
78configuration section of the form:
79
80------------
81 [url "<actual url base>"]
82 pushInsteadOf = <other url base>
83------------
84
85For example, with this:
86
87------------
88 [url "ssh://example.org/"]
89 pushInsteadOf = git://example.org/
90------------
91
92a URL like "git://example.org/path/to/repo.git" will be rewritten to
93"ssh://example.org/path/to/repo.git" for pushes, but pulls will still
94use the original URL.