RE: Vendor branches on sourceware.org's binutils-gdb repo

Matthew Fortune
2014-04-07T15:16:54Z

> > So how do I tell git to only clone master and not give me everybody
> > else's shit? Last time I tried to do that, it simply didn't work.
>
> git-clone(1):
>
> --[no-]single-branch
> Clone only the history leading to the tip of a single branch,
> either specified by the --branch option or the primary branch
> remote’s HEAD points at.

If space is a problem and the purpose of the clone is mainly to perform a
build then you may also be interested in --depth. It comes with a health
warning but really reduces the overheads if it is suitable for you:

--depth <depth>
Create a shallow clone with a history truncated to the specified
number of revisions. A shallow repository has a number of
limitations (you cannot clone or fetch from it, nor push from
nor into it), but is adequate if you are only interested in the
recent history of a large project with a long history, and would
want to send in fixes as patches.

Matthew