On Tue, Feb 21, 2017 at 06:11:51AM +0100, Toolforger wrote: > > I'm not sure I understand. You have a project policy to use certain > > URLs. But you, the user, want to override that. Why isn't the > > user-specific config file the right place to put that? > > Ah right, I mistook ~/ for "project root" instead of "home dir". > Sorry for the confusion. Ah, OK, that makes more sense. > > (I think there _is_ a mismatch, in that the change is specific not just > > to your user, but to the repo. So you would not want to rewrite other > > references to the same URL in other repos. > > Indeed, and that's actually a problem. > > The setup I'm aiming for is > github -> local bare repo -> local clones with worktrees > > If I place insteadOf rules in ~/.gitconfig, I will be unable to pull from > github to my local bare repos. > Mmm... I could try to undo the insteadOf configuration from ~/.gitconfig in > the local bare repos. Not sure whether I have to redirect from the github > URL to itself. Yeah, I think you would probably have to do a redirect-to-self to override the global one. At one point we discussed having conditional-config that would kick in based on path-matching. I think it would be another way to do what you want, but there's nothing merged. I think anything involving ~/.gitconfig is basically a hack, though. What you really want is for submodules to better support your URL-rewriting case, and that's not an unreasonable thing to want. We'll see if the submodule folks have any ideas on how to implement that. -Peff