@ -1,44 +1,57 @@
GIT URLS[[URLS]]
GIT URLS[[URLS]]
----------------
----------------
One of the following notations can be used
In general, URLs contain information about the transport protocol, the
to name the remote repository:
address of the remote server, and the path to the repository.
Depending on the transport protocol, some of this information may be
absent.
Git natively supports ssh, git, http, https, ftp, ftps, and rsync
protocols. The following syntaxes may be used with them:
- rsync://host.xz/path/to/repo.git/
- http://host.xz{startsb}:port{endsb}/path/to/repo.git/
- https://host.xz{startsb}:port{endsb}/path/to/repo.git/
- git://host.xz{startsb}:port{endsb}/path/to/repo.git/
- git://host.xz{startsb}:port{endsb}/~user/path/to/repo.git/
- ssh://{startsb}user@{endsb}host.xz{startsb}:port{endsb}/path/to/repo.git/
- ssh://{startsb}user@{endsb}host.xz{startsb}:port{endsb}/path/to/repo.git/
- ssh://{startsb}user@{endsb}host.xz/path/to/repo.git/
- git://host.xz{startsb}:port{endsb}/path/to/repo.git/
- ssh://{startsb}user@{endsb}host.xz/~user/path/to/repo.git/
- http{startsb}s{endsb}://host.xz{startsb}:port{endsb}/path/to/repo.git/
- ssh://{startsb}user@{endsb}host.xz/~/path/to/repo.git
- ftp{startsb}s{endsb}://host.xz{startsb}:port{endsb}/path/to/repo.git/
- rsync://host.xz/path/to/repo.git/
SSH is the default transport protocol over the network. You can
An alternative scp-like syntax may also be used with the ssh protocol:
optionally specify which user to log-in as, and an alternate,
scp-like syntax is also supported. Both syntaxes support
username expansion, as does the native git protocol, but
only the former supports port specification. The following
three are identical to the last three above, respectively:
- {startsb}user@{endsb}host.xz:/path/to/repo.git/
- {startsb}user@{endsb}host.xz:path/to/repo.git/
- {startsb}user@{endsb}host.xz:~user/path/to/repo.git/
- {startsb}user@{endsb}host.xz:path/to/repo.git
To sync with a local directory, you can use:
The ssh and git protocols additionally support ~username expansion:
- ssh://{startsb}user@{endsb}host.xz{startsb}:port{endsb}/~{startsb}user{endsb}/path/to/repo.git/
- git://host.xz{startsb}:port{endsb}/~{startsb}user{endsb}/path/to/repo.git/
- {startsb}user@{endsb}host.xz:/~{startsb}user{endsb}/path/to/repo.git/
For local respositories, also supported by git natively, the following
syntaxes may be used:
- /path/to/repo.git/
- /path/to/repo.git/
- file:///path/to/repo.git/
- file:///path/to/repo.git/
ifndef::git-clone[]
ifndef::git-clone[]
They are mostly equivalent, except when cloning. See
These two syntaxes are mostly equivalent, except when cloning, when
linkgit:git-clone[1] for details.
the former implies --local option. See linkgit:git-clone[1] for
details.
endif::git-clone[]
endif::git-clone[]
ifdef::git-clone[]
ifdef::git-clone[]
They are equivalent, except the former implies --local option.
These two syntaxes are mostly equivalent, except the former implies
--local option.
endif::git-clone[]
endif::git-clone[]
When git doesn't know how to handle a certain transport protocol, it
attempts to use the 'remote-<transport>' remote helper, if one
exists. To explicitly request a remote helper, the following syntax
may be used:
- <transport>::<address>
where <address> may be a path, a server and path, or an arbitrary
URL-like string recognized by the specific remote helper being
invoked. See linkgit:git-remote-helpers[1] for details.
If there are a large number of similarly-named remote repositories and
If there are a large number of similarly-named remote repositories and
you want to use a different format for them (such that the URLs you
you want to use a different format for them (such that the URLs you