Thread (10 messages) flat view 10 messages, 5 authors, 2016-06-15

Re: Overriding ~/.gitconfig using GIT_CONFIG

From: Jeff King <hidden>
Date: 2016-06-15 22:51:57

On Tue, Aug 30, 2011 at 07:39:05PM +0100, Richard Purdie wrote:
On Tue, 2011-08-30 at 11:56 -0400, Jeff King wrote:
quoted
On Tue, Aug 30, 2011 at 01:13:01PM +0100, Richard Purdie wrote:
quoted
We've gone through several iterations of this but as things stand now,
to initially clone things we're doing:

git clone --bare --mirror <url> <dir>

but if we already have some existing clone we'd update with:

git remote prune origin
git remote rm origin
git remote add --mirror origin <url>
git fetch --all -t

[...]

So if a user has an origin remote in their .gitconfig, can we ignore it?
Wouldn't:

  git fetch --prune <url> refs/heads/*:refs/remotes/origin/*

do what you want, and not look at config at all?
Since this is a bare/mirror clone, wouldn't that need to be:

 git fetch --prune <url> refs/heads/*:refs/heads/*
Sorry, yes, I forgot about the mirroring bit.
That also wouldn't fetch tags?
It would only do autofollowing. You could use "-t", but if you really
want a straight mirror, you could do:

  git fetch --prune refs/*:refs/*

to get everything.

-Peff
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help