Skip to content

Instantly share code, notes, and snippets.

@Flouse
Created May 11, 2021 09:52
Show Gist options
  • Save Flouse/a441171596c4fdeed40c481934aa3118 to your computer and use it in GitHub Desktop.
Save Flouse/a441171596c4fdeed40c481934aa3118 to your computer and use it in GitHub Desktop.
Clone part of a git project
# https://stackoverflow.com/a/28039894/7365437
git init <repo>
cd <repo>
git remote add origin <url>
git config core.sparsecheckout true
echo "path/to/your/dir/*" >> .git/info/sparse-checkout
git pull --depth=1 origin branch_you_want
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment