summaryrefslogtreecommitdiff
path: root/Documentation/urls.txt
diff options
context:
space:
mode:
authorLibravatar Daniel Barkalow <barkalow@iabervon.org>2008-02-20 13:43:53 -0500
committerLibravatar Junio C Hamano <gitster@pobox.com>2008-02-24 20:05:29 -0800
commit55029ae4dac07942437c0c715ea7c8ac60dd3576 (patch)
treeb2e278bd16f852229e3a3149febb7df98171951b /Documentation/urls.txt
parentUse ALLOC_GROW in remote.{c,h} (diff)
downloadtgif-55029ae4dac07942437c0c715ea7c8ac60dd3576.tar.xz
Add support for url aliases in config files
This allows users with different preferences for access methods to the same remote repositories to rewrite each other's URLs by pattern matching across a large set of similiarly set up repositories to each get the desired access. For example, if you don't have a kernel.org account, you might want settings like: [url "git://git.kernel.org/pub/"] insteadOf = master.kernel.org:/pub Then, if you give git a URL like: master.kernel.org:/pub/scm/linux/kernel/git/linville/wireless-2.6.git it will act like you gave it: git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6.git and you can cut-and-paste pull requests in email without fixing them by hand, for example. Signed-off-by: Daniel Barkalow <barkalow@iabervon.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/urls.txt')
-rw-r--r--Documentation/urls.txt23
1 files changed, 23 insertions, 0 deletions
diff --git a/Documentation/urls.txt b/Documentation/urls.txt
index 81ac17f32a..fa34c67471 100644
--- a/Documentation/urls.txt
+++ b/Documentation/urls.txt
@@ -44,3 +44,26 @@ endif::git-clone[]
ifdef::git-clone[]
They are equivalent, except the former implies --local option.
endif::git-clone[]
+
+
+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
+use will be rewritten into URLs that work), you can create a
+configuration section of the form:
+
+------------
+ [url "<actual url base>"]
+ insteadOf = <other url base>
+------------
+
+For example, with this:
+
+------------
+ [url "git://git.host.xz/"]
+ insteadOf = host.xz:/path/to/
+ insteadOf = work:
+------------
+
+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".
+