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

Re: Clone with local alternates?

From
Shawn Pearce <spearce@spearce.org>
Date
Apr 18, 2006, 23:56 UTC
Message-ID
<20060418235658.GB8915@spearce.org>
In-Reply-To
<1145404132.16166.97.camel@shinybook.infradead.org>
David Woodhouse <dwmw2@infradead.org> wrote:
Show 11 quoted lines
> Often I want to clone a remote repository but would like to use an
> existing local source tree as 'alternates'. 
> 
> One way of doing this is to clone the local tree with 'git-clone -l -s',
> find the latest common commit shared with the remote tree to be fetched,
> revert to that with 'git-reset --head $last' and then pulling from the
> remote. 
> 
> Is that _really_ the best way of doing it though? It would be better if
> we just had a '--local-alternates=/foo' option to git-clone when cloning
> a remote repository.
  git clone --reference=/foo git://remote/foo

would do the trick. This is new in 1.3.0. I just noticed its also not documented in 1.3.0. :-)

-- 
Shawn.
Previous: David WoodhouseNext: David Woodhouse
Message 2 of 7 in “Clone with local alternates?”
  1. David WoodhouseApr 18, 2006
  2. Shawn PearceApr 18, 2006
  3. David WoodhouseApr 18, 2006
  4. Document git-clone --referenceShawn Pearce, Apr 19, 2006
  5. David WoodhouseApr 19, 2006
  6. Eric W. BiedermanApr 19, 2006
  7. Eric W. BiedermanApr 19, 2006

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.