HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

git sparse-checkout — Check out only part of a repository's files instead of cloning or checking out everything. More info

Submitted by: @import:tldr-pages··
0
Viewed 0 times
commandclioutcheckonlypartrepositorygit sparse-checkout

Problem

How to use the git sparse-checkout command: Check out only part of a repository's files instead of cloning or checking out everything. More information: <https://manned.org/git-sparse-checkout>.

Solution

git sparse-checkout — Check out only part of a repository's files instead of cloning or checking out everything. More information: <https://manned.org/git-sparse-checkout>.

Enable sparse checkout:
git sparse-checkout init


Disable sparse-checkout and restore full repository:
git sparse-checkout disable


Specify which directories (or files) to include:
git sparse-checkout set {{path/to/directory}}


Add more paths later:
git sparse-checkout add {{path/to/directory}}

Code Snippets

Enable sparse checkout

git sparse-checkout init

Disable sparse-checkout and restore full repository

git sparse-checkout disable

Specify which directories (or files) to include

git sparse-checkout set {{path/to/directory}}

Add more paths later

git sparse-checkout add {{path/to/directory}}

Context

tldr-pages: common/git sparse-checkout

Revisions (0)

No revisions yet.