git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Question on GIT tutorial.

From
Junio C Hamano <junkio@cox.net>
Date
Nov 18, 2005, 07:24 UTC
Message-ID
<7vd5kyo1v1.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<7vlkznt5tc.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano <junkio@cox.net> writes:
Show 10 quoted lines
>> """
>> Copy over the packed files from "project lead" public repository to
>> your public repository.
>> """
>>
>> Why is it needed ?
>
> That was a remnant from the days some transports did not
> understand objects/info/alternates; I think we do not need that
> step anymore.

After re-reading that section, I take it back. What I meant to say there was this:

   You are the subsystem maintainer, so your tree would have
   many overlapping objects with your project lead.  So in step
   2, you prepare an empty repository first, and then in step
   3., copy the packs from the project lead.  Then pushing into
   that repository in step 4 would prevent the objects you
   inherited from your project lead from getting expanded in
   your public repository.

But these days, there is a more efficient way *if* your public repository resides on the same machine as the public repository of your project lead. First, on the public repository side:

   pub$ export GIT_DIR=/pub/my.git
   pub$ HIS_GIT=/pub/his.git
   pub$ git-init-db
   pub$ echo "$HIS_GIT/objects" >"$GIT_DIR/objects/info/alternates"
   pub$ (cd "$HIS_GIT/refs" && tar - heads tags) |
        (cd "$GIT_DIR/refs" && mkdir j.u.n.k && cd j.u.n.k && tar xf -)

This makes your repository to have the same refs as your project lead has but under funny names. Then from your primary development repository, you push into your public repository:

   home$ git-send-pack --all ssh://pub.repo.xz/pub/my.git/

Thanks to the funny refs you stole from your project lead when you prepared your public repository, this transfer sends only objects the project lead does not have, and your refs. After this is done, you can get rid of the funny refs you stole from your project lead:

   pub$ cd "$GIT_DIR/refs" && rm -fr j.u.n.k

If your public repository is not on the same machine as your project lead's, objects/info/alternates trick cannot be used, so what we have in the tutorial section still applies.

Previous: Junio C Hamano
Message 3 of 3 in “Question on GIT tutorial.”
  1. FranckNov 14, 2005
  2. Junio C HamanoNov 17, 2005
  3. Junio C HamanoNov 18, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.