Skip to content

Instantly share code, notes, and snippets.

@BDF
Created October 11, 2021 19:36
Show Gist options
  • Save BDF/347ffb2989b161a4840c320e72bc8f74 to your computer and use it in GitHub Desktop.
Save BDF/347ffb2989b161a4840c320e72bc8f74 to your computer and use it in GitHub Desktop.
git Sparse Checkout.
#!/usr/bin/env bash
# Copied from:
# https://github.blog/2020-01-17-bring-your-monorepo-down-to-size-with-sparse-checkout/
% git clone --no-checkout https://github.com/derrickstolee/sparse-checkout-example --depth 1
% cd sparse-checkout-example/
% git sparse-checkout init --cone
# git sparse-checkout init to skip top level files.
% git sparse-checkout set <DIR1> <DIR2>
# git co <BRANCH>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment