Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>In Git land you are talking about three different types of partial clones:</p> <ul> <li><p><strong><em>shallow clones:</em></strong> I want history from revision point X onward.</p> <p><strong>Use <code>git clone --depth &lt;n&gt; &lt;url&gt;</code></strong> for that, but please remember that shallow clones are somewhat limited in interacting with other repositories. You would be able to generate patches and send them via email.</p></li> <li><p><strong><em>partial clone by filepath:</em></strong> I want all revision history history in some directory <code>/path</code>.</p> <p><strong>Not possible</strong> in Git. With modern Git though you can have <em>sparse checkout</em>, i.e. you have whole history but you check out (have in working area) only subset of all files.</p></li> <li><p><strong><em>cloning only selected branch:</em></strong> I want to clone only one branch (or selected subset of branches).</p> <p><strong>Possible, and</strong></p> <p>before git 1.7.10 not simple: you would need to do what clone does manually, i.e. <code>git init [&lt;directory&gt;]</code>, then <code>git remote add origin &lt;url&gt;</code>, edit <code>.git/config</code> replacing <code>*</code> in <code>remote.origin.fetch</code> by requested branch (probably 'master'), then <code>git fetch</code> .</p> <p><a href="https://raw.github.com/gitster/git/master/Documentation/RelNotes/1.7.10.txt" rel="noreferrer">as of git 1.7.10</a> <code>git clone</code> offers the <a href="https://www.kernel.org/pub/software/scm/git/docs/git-clone.html" rel="noreferrer"><code>--single-branch</code></a> option which seems like it was added just for this purpose, and seems pretty easy.</p> <p>Note however that because branches usually share most of their history, the gain from cloning only a subset of branches might be smaller than you think.</p></li> </ul> <p>You can also do a shallow clone of only selected subset of branches.</p> <p>If you know how people will want to break things down by filepath (multiple projects in the same repository) you can use submodules (sort of like svn:externals) to pre-split the repo into separately cloneable portions.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload