Using url.insteadOf in git-clone
- From
- Pieter de Bie <pdebie@ai.rug.nl>
- Date
- Jun 27, 2008, 09:35 UTC
- Message-ID
- <27C25D70-0BFC-4362-A771-C7CAD89BC198@ai.rug.nl>
Hi,
I sometimes use url.insteadOf to create a shortcut to a central repository. For example, having something like[*1*]
[url "git://repo.or.cz/git/"] insteadOf = "repo:"
in my global gitconfig allows me to do a 'git fetch repo:dscho.git'. I'd also like to use that with git clone :). Currently if I try that, I get
Vienna:~ pieter$ git clone repo:dscho.git Initialize dscho/.git Initialized empty Git repository in /Users/pieter/dscho/.git/ ssh: Error resolving hostname repo: nodename nor servname provided, or not known fatal: The remote end hung up unexpectedly
Which I think comes from the fact that the global config isn't read in by remote.c when running git clone.
Now, I seem to remember there was a good reason for this (both builtin- clone and git-clone.sh have the same behaviour). Also, trying to quickly hack in something failed for me, even though it seems like a trivial change to make for someone more familiar with the code path.
Is there an easy fix for this?
- Pieter
[1] This is not really true. If I try that, I get an error: Vienna:git pieter$ git fetch -v repo:dscho.git fatal: I don't handle protocol 'it'
If I change the url to "ggit://.." it does work. It seems there is an off-by-one error somewhere? It does work for another url.insteadOf I have in my global config though..