Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I believe git provides that functionality through sparse-checkout. You can clone a repository without checking it out, then use sparse-checkout to only pull the paths you want.


sparse-checkout only reduces the number of files copied from the local repo to the working directory. It doesn't affect the amount downloaded data. For that you need shallow and partial clones (shallow clones give you a subset of history, partial clones give you a subset of the files within that history). Partial clones especially are a relatively new and not heavily used git feature.


Partial clone with the --filter feature seems complicated to use. You need to use a bunch of command to set it up and then it looks like you still need to be careful while using it.

I'd dream of somethong as simple as

   git clone --partial foo/bar https://example.com/some.repo.git
And then everything would work normally.


Your dream came true ;) This is what Josh does:

  git clone https://example.com/some.repo.git:/foo/bar.git
And then everything works normally.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: