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