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.