Code

Merge branch 'mg/mailmap-update' into maint
[git.git] / Documentation / urls.txt
index 5355ebc0f39114823f830e0651078a99f0ac2e70..459a394dc0eb2c7ebecc7c9cf53808d791187006 100644 (file)
@@ -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 "<actual url base>"]
+               pushInsteadOf = <other url base>
+------------
+
+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.