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

Re: Additional remote on a local clone. Where do the objects go?

From
Tay Ray Chuan <rctay89@gmail.com>
Date
Sep 1, 2010, 10:32 UTC
Message-ID
<AANLkTi=_uP_zFOV_k=cM8TXH16kTPAoPGpNkz+QUSzb-@mail.gmail.com>
In-Reply-To
<i5kudr$dp7$1@dough.gmane.org>
Hi,
On Wed, Sep 1, 2010 at 3:12 PM, Stephen Kelly <steveire@gmail.com> wrote:
Show 10 quoted lines
> git clone git://gitorious.org/qt/qt.git qtrepo
> cd qtrepo
> git checkout -b 4.7 origin/4.7
> git checkout -b 4.6 origin/4.6
> git clone qtrepo qt46
> cd qt46 && git checkout -b 4.6 origin/4.6
> cd ..
> git clone qtrepo qt47
> cd qt46 && git checkout -b 4.7 origin/4.7
> cd ..
Two improvements: shared objects, and configuring git-pull:
  git clone git://gitorious.org/qt/qt.git qtrepo
  git init qt46
  PARENT_GIT=$(pwd)/qtrepo/.git
  cd qt46
  # use of shared objects - tell git where to find the "missing" objects
  cat $PARENT_GIT/objects > .git/objects/info/alternates
  # setup of git pull
  cat <<EOF >> .git/config
[remote "parent"]
  url = $PARENT_GIT
[branch "master"]
  remote = parent
  merge = refs/remotes/origin/4.6
EOF
  # done!
  git pull
Repeat for 4.7.

If you want to go one step further and track these repos, you could look at git-submodule or git-subtree.

-- 
Cheers,
Ray Chuan
Previous: Stephen KellyNext: Stephen Kelly
Message 2 of 6 in “Additional remote on a local clone. Where do the objects go?”
  1. Stephen KellySep 1, 2010
  2. Tay Ray ChuanSep 1, 2010
  3. Stephen KellySep 1, 2010
  4. Tay Ray ChuanSep 4, 2010
  5. Stephen KellySep 5, 2010
  6. Jakub NarebskiSep 1, 2010

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.