git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Wishlist: git fetch --reference
@ 2014-08-22  2:57 Howard Chu
  2014-08-22  4:20 ` Jeff King
  2014-08-22  7:01 ` Dennis Kaarsemaker
  0 siblings, 2 replies; 4+ messages in thread
From: Howard Chu @ 2014-08-22  2:57 UTC (permalink / raw)
  To: git

I maintain multiple copies of the same repo because I keep each one checked 
out to different branch/rev levels. It would be nice if, similar to clone 
--reference, we could also use git fetch --reference to reference a local repo 
when doing a fetch to pull in updates.

-- 
   -- Howard Chu
   CTO, Symas Corp.           http://www.symas.com
   Director, Highland Sun     http://highlandsun.com/hyc/
   Chief Architect, OpenLDAP  http://www.openldap.org/project/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Wishlist: git fetch --reference
  2014-08-22  2:57 Wishlist: git fetch --reference Howard Chu
@ 2014-08-22  4:20 ` Jeff King
  2014-08-22  5:25   ` Howard Chu
  2014-08-22  7:01 ` Dennis Kaarsemaker
  1 sibling, 1 reply; 4+ messages in thread
From: Jeff King @ 2014-08-22  4:20 UTC (permalink / raw)
  To: Howard Chu; +Cc: git

On Thu, Aug 21, 2014 at 07:57:47PM -0700, Howard Chu wrote:

> I maintain multiple copies of the same repo because I keep each one checked
> out to different branch/rev levels. It would be nice if, similar to clone
> --reference, we could also use git fetch --reference to reference a local
> repo when doing a fetch to pull in updates.

I think it is just spelled:

  echo $reference_repo >>.git/objects/info/alternates
  git fetch

We need "--reference" with clone because that first line needs to happen
after clone runs "git init" but before it runs "git fetch". And if you
cloned with --reference, of course, the alternates file remains and
further fetches will automatically use it.

-Peff

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Wishlist: git fetch --reference
  2014-08-22  4:20 ` Jeff King
@ 2014-08-22  5:25   ` Howard Chu
  0 siblings, 0 replies; 4+ messages in thread
From: Howard Chu @ 2014-08-22  5:25 UTC (permalink / raw)
  To: Jeff King; +Cc: git

Jeff King wrote:
> On Thu, Aug 21, 2014 at 07:57:47PM -0700, Howard Chu wrote:
>
>> I maintain multiple copies of the same repo because I keep each one checked
>> out to different branch/rev levels. It would be nice if, similar to clone
>> --reference, we could also use git fetch --reference to reference a local
>> repo when doing a fetch to pull in updates.
>
> I think it is just spelled:
>
>    echo $reference_repo >>.git/objects/info/alternates
>    git fetch
>
> We need "--reference" with clone because that first line needs to happen
> after clone runs "git init" but before it runs "git fetch". And if you
> cloned with --reference, of course, the alternates file remains and
> further fetches will automatically use it.

Aha, thanks, hadn't realized that. Just checked and yes, the alternates file 
is already set in all of these different copies.

-- 
   -- Howard Chu
   CTO, Symas Corp.           http://www.symas.com
   Director, Highland Sun     http://highlandsun.com/hyc/
   Chief Architect, OpenLDAP  http://www.openldap.org/project/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Wishlist: git fetch --reference
  2014-08-22  2:57 Wishlist: git fetch --reference Howard Chu
  2014-08-22  4:20 ` Jeff King
@ 2014-08-22  7:01 ` Dennis Kaarsemaker
  1 sibling, 0 replies; 4+ messages in thread
From: Dennis Kaarsemaker @ 2014-08-22  7:01 UTC (permalink / raw)
  To: Howard Chu; +Cc: git

On do, 2014-08-21 at 19:57 -0700, Howard Chu wrote:
> I maintain multiple copies of the same repo because I keep each one checked 
> out to different branch/rev levels. It would be nice if, similar to clone 
> --reference, we could also use git fetch --reference to reference a local repo 
> when doing a fetch to pull in updates.

Alternatively, you can use Duy's multiple-work-trees patches to safely
make multiple checkouts of one repository. These patches are in next.  
-- 
Dennis Kaarsemaker
http://www.kaarsemaker.net

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-08-22  7:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-22  2:57 Wishlist: git fetch --reference Howard Chu
2014-08-22  4:20 ` Jeff King
2014-08-22  5:25   ` Howard Chu
2014-08-22  7:01 ` Dennis Kaarsemaker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).