Checkout subtree

Create and initialize your new repository:

$> mkdir <repo> && cd <repo>
$> git init
$> git remote add –f <name> <url>

Enable sparse-checkout:

$> git config core.sparsecheckout true

Configure sparse-checkout by listing your desired sub-trees in .git/info/sparse-checkout:

$> echo some/dir/ >> .git/info/sparse-checkout
$> echo another/sub/tree >> .git/info/sparse-checkout

Checkout from the remote:

$> git pull <remote> <branch>

One thought on “Checkout subtree

Leave a Reply

Your email address will not be published.

 

This site uses Akismet to reduce spam. Learn how your comment data is processed.