Re: Quick way to clone exactly one branch

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

 



Jeff King <peff@xxxxxxxx> writes:

> On Wed, May 20, 2009 at 04:45:44PM -0400, Avery Pennarun wrote:
> 
> > Is there a quick alternative to the following?
> > 
> >    mkdir myproj
> >    cd myproj
> >    git init
> >    git fetch git://whatever master
> >    git checkout -b master FETCH_HEAD
> > 
> > Basically, the above is a lot like 'git clone' but only clones the
> > 'master' branch.  For really big projects with lots of junk in other
> > branches, the above can save a lot of bandwidth.
> 
> No, AFAIK there isn't a simpler way to do it. But it is something people
> have asked about before, so I think it would be a nice addition.
> 
> You can't even use "git remote" because it doesn't allow you to tweak
> the refspecs you add. [...]

It doesn't? Strange, I thought that is what '-t <branch>' option
for "git remote add" for ;-))))

-- 
Jakub Narebski
Poland
ShadeHawk on #git
--
To unsubscribe from this list: 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]