0

I have some CI process with initial step that clones the repository using git clone

In this repository i have a lot of images that not mandatory for the CI step, they downloaded by default by the git clone command.

Is there a was not to clone files with specified extension like .jpeg?

Thanks.

Alexander Gorelik
  • 3,985
  • 6
  • 37
  • 53
  • Are the images in a certain directory you can ignore entirely? You can then do a sparse checkout, excluding that directory. – CodeCaster Nov 14 '18 at 11:38
  • 1
    Possible duplicate of [git clone, ignoring a directory](https://stackoverflow.com/questions/14326365/git-clone-ignoring-a-directory) – CodeCaster Nov 14 '18 at 11:38
  • @CodeCaster The images located in many directories, i would like to ignore by type not directory – Alexander Gorelik Nov 14 '18 at 11:41
  • GIT is not designed like that. Your presuming that you can access chunks of the repo at any given point, each commit is a full copy of the entire repo (kinda). So no you can't do this, also you wouldn't really gain anything. To access anything in GIT you need to first clone the entire repo. Each clone is a **complete copy of the entire repo**, history, files, everything. Even the dupe by code caster actually [clones these files](https://stackoverflow.com/questions/14326365/git-clone-ignoring-a-directory#comment77700956_41162452) it just then doesn't extract everything. – Liam Nov 14 '18 at 11:57
  • [this is the correct answer](https://stackoverflow.com/a/14326452/542251) (IMO) to that dupe – Liam Nov 14 '18 at 11:58
  • A better answer would be [shallow clone](https://stackoverflow.com/search?q=%5Bgit%5D+shallow+clone) plus may be [sparse checkout](https://stackoverflow.com/search?q=%5Bgit%5D+sparse+checkout). – phd Nov 14 '18 at 13:45

0 Answers0