X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=Documentation%2Furls.txt;h=459a394dc0eb2c7ebecc7c9cf53808d791187006;hb=e80014a13e86f47a172620567608e627427ceeeb;hp=5355ebc0f39114823f830e0651078a99f0ac2e70;hpb=d91ba8fa88a83ec70588700a56c8a4c1e8beb1be;p=git.git diff --git a/Documentation/urls.txt b/Documentation/urls.txt index 5355ebc0f..459a394dc 100644 --- a/Documentation/urls.txt +++ b/Documentation/urls.txt @@ -4,7 +4,6 @@ GIT URLS[[URLS]] One of the following notations can be used to name the remote repository: -=============================================================== - 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/ @@ -14,7 +13,6 @@ to name the remote repository: - ssh://{startsb}user@{endsb}host.xz/path/to/repo.git/ - ssh://{startsb}user@{endsb}host.xz/~user/path/to/repo.git/ - ssh://{startsb}user@{endsb}host.xz/~/path/to/repo.git -=============================================================== SSH is the default transport protocol over the network. You can optionally specify which user to log-in as, and an alternate, @@ -23,18 +21,14 @@ 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:~user/path/to/repo.git/ - {startsb}user@{endsb}host.xz:path/to/repo.git -=============================================================== To sync with a local directory, you can use: -=============================================================== - /path/to/repo.git/ - file:///path/to/repo.git/ -=============================================================== ifndef::git-clone[] They are mostly equivalent, except when cloning. See @@ -67,3 +61,21 @@ For example, with this: a URL like "work:repo.git" or like "host.xz:/path/to/repo.git" will be rewritten in any context that takes a URL to be "git://git.host.xz/repo.git". +If you want to rewrite URLs for push only, you can create a +configuration section of the form: + +------------ + [url ""] + pushInsteadOf = +------------ + +For example, with this: + +------------ + [url "ssh://example.org/"] + pushInsteadOf = git://example.org/ +------------ + +a URL like "git://example.org/path/to/repo.git" will be rewritten to +"ssh://example.org/path/to/repo.git" for pushes, but pulls will still +use the original URL.