aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/urls.txt
diff options
context:
space:
mode:
authorJosh Triplett <josh@joshtriplett.org>2009-09-07 01:56:33 -0700
committerJunio C Hamano <gitster@pobox.com>2009-09-08 01:18:46 -0700
commit1c2eafb89bcaf2ddbf4dfb93df19673c0fadaaeb (patch)
treea5bab1eb2438c01427e663b629505b30861401ba /Documentation/urls.txt
parentd071d942963fa76b11826f25c54fdfd8b09d7626 (diff)
downloadgit-1c2eafb89bcaf2ddbf4dfb93df19673c0fadaaeb.tar.gz
Add url.<base>.pushInsteadOf: URL rewriting for push only
This configuration option allows systematically rewriting fetch-only URLs to push-capable URLs when used with push. For instance: [url "ssh://example.org/"] pushInsteadOf = "git://example.org/" This will allow clones of "git://example.org/path/to/repo" to subsequently push to "ssh://example.org/path/to/repo", without manually configuring pushurl for that remote. Includes documentation for the new option, bash completion updates, and test cases (both that pushInsteadOf applies to push, that it does not apply to fetch, and that it is ignored when pushURL is already defined). Signed-off-by: Josh Triplett <josh@joshtriplett.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/urls.txt')
-rw-r--r--Documentation/urls.txt18
1 files changed, 18 insertions, 0 deletions
diff --git a/Documentation/urls.txt b/Documentation/urls.txt
index 5355ebc0f3..d813ceb723 100644
--- a/Documentation/urls.txt
+++ b/Documentation/urls.txt
@@ -67,3 +67,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.