Re: How to mirror and augment a git repository

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Mar 08, 2023 at 04:54:39PM +0000, Sebastian Tennant wrote:

> > 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



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux