Re: How to mirror and augment a git repository
- From
Jeff King <peff@peff.net>
- Date
- Mar 9, 2023, 03:12 UTC
- Message-ID
- <ZAlOnTovp0ncZopf@coredump.intra.peff.net>
- In-Reply-To
- <87fsaf9oa8.fsf@sebyte.me>
On Wed, Mar 08, 2023 at 04:54:39PM +0000, Sebastian Tennant wrote:
Show 22 quoted lines
> > You could use the normal "+refs/heads/*:refs/remotes/origin/*" refspec, > > but it's awkward for the clients to access "refs/remotes/" on the > > mirror. > > Indeed. To fetch a known ref, a client (also with the normal fetch > refspec) would have to do something like this, for example: > > $ git fetch origin\ > refs/remotes/origin/<ref>:refs/remotes/upstream/<ref> > > Alternatively, they could add an additional fetch refspec to their > config: > > [remote="origin"] > ... > fetch = +refs/heads/*:refs/remotes/origin/* # normal > fetch = +refs/remotes/origin/*:refs/remotes/upstream/* # additional > > This would have the advantage of fetching all the upstream refs on the > next update giving them a better idea of what's happening upstream. > > Is my understanding more or less correct?
Yes, that's exactly correct. In some ways it is cleaner than using "refs/heads/upstream" because it leaves the whole "refs/heads/" namespace intact for local client branches. It depends on how much of a pain it is to configure the extra refspec in each client. :)
-Peff