Re: Clone with local alternates?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



David Woodhouse <dwmw2@xxxxxxxxxxxxx> wrote:
> 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.
-
: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]