Git - How to download only a directory

1 - About

This page is about how to download a part of a git repository

3 - Example

3.1 - curl

Example with curl if you want to download only the directory located at subir/subdir

curl \
  | tar -xz --strip=2  repository/subir/subdir


curl | tar -xz --strip=2  material-ui-master/examples/nextjs-with-typescript
cd nextjs-with-typescript

If the direcrtory is a code project in itself, you can open it with codesandbox. Example:
<!-- real example -->

Data Science
Data Analysis
Data Science
Linear Algebra Mathematics

Powered by ComboStrap