Monday, September 19, 2011

Fun with url.$that.insteadOf

It is not exactly fun that I and others have to do this, but while k.org is down:

$ git -c url.http://code.google.com/p/git-core.insteadof=git://git.kernel.org/pub/scm/git/git.git fetch

lets me reuse all the fetch refspec configuration items I have for the "origin" remote.

To make this semi-permanent, I could have the following in my $HOME/.gitconfig but I have been hoping that k.org would come back before I actually do it and haven't done so:

[url "http://code.google.com/p/git-core"]
  insteadOf = git://git.kernel.org/pub/scm/git/git.git

Not exactly fun, but...

1 comment:

Stefan Naewe said...

This is really one of my favourite features of the (IMHO) best DVCS around. I always use it to clone repos via HTTP(s) when I'm behind our
very restrictive firewall and I want to copy and paste a git URL from a webpage for example (git://github.com/user/repo.git -> http://github.com/user/repo.git)