summaryrefslogtreecommitdiff
path: root/Documentation
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2009-09-13 01:33:20 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2009-09-13 01:33:20 -0700
commit79cb645f9ac69f9e3c43e0265c247e47bb20037e (patch)
tree2ede4c243308f403bcd07f1353e7e1e64a81369c /Documentation
parentMerge branch 'jk/unwanted-advices' (diff)
parentAdd url.<base>.pushInsteadOf: URL rewriting for push only (diff)
downloadtgif-79cb645f9ac69f9e3c43e0265c247e47bb20037e.tar.xz
Merge branch 'jt/pushinsteadof'
* jt/pushinsteadof: Add url.<base>.pushInsteadOf: URL rewriting for push only Wrap rewrite globals in a struct in preparation for adding another set
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/config.txt13
-rw-r--r--Documentation/urls.txt18
2 files changed, 31 insertions, 0 deletions
diff --git a/Documentation/config.txt b/Documentation/config.txt
index 8cbabe8012..be0b8cacaa 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -1515,6 +1515,19 @@ url.<base>.insteadOf::
never-before-seen repository on the site. When more than one
insteadOf strings match a given URL, the longest match is used.
+url.<base>.pushInsteadOf::
+ Any URL that starts with this value will not be pushed to;
+ instead, it will be rewritten to start with <base>, and the
+ resulting URL will be pushed to. In cases where some site serves
+ a large number of repositories, and serves them with multiple
+ access methods, some of which do not allow push, this feature
+ allows people to specify a pull-only URL and have git
+ automatically use an appropriate URL to push, even for a
+ never-before-seen repository on the site. When more than one
+ pushInsteadOf strings match a given URL, the longest match is
+ used. If a remote has an explicit pushurl, git will ignore this
+ setting for that remote.
+
user.email::
Your email address to be recorded in any newly created commits.
Can be overridden by the 'GIT_AUTHOR_EMAIL', 'GIT_COMMITTER_EMAIL', and
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.