Naveed Hematmal
Naveed Hematmal

Reputation: 383

How to ignore some files from repo while cloning from Github?

While pushing files to Github, we can ignore files from the Git repo. Can we ignore files while downloading from Github? There are YAML, CONTRIBUTION, CODE_OF_CONDUCT, etc files in Github that we don't want to download from Github while cloning the repo.

Upvotes: 1

Views: 2737

Answers (1)

VonC
VonC

Reputation: 1324347

You can do a partial clone, which is stricter than a sparse checkout:

  • a sparse checkout means: you clone everything but restore only some files in the working tree.
  • a partial clone means: you clone only what you need (then restore everything cloned in the working tree)

The partial clone uses a git rev-list --filter option.

Upvotes: 1

Related Questions