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

I think you can clone just the last commit:

> Provide an argument of -- depth 1 to the git clone command to copy only the latest revision of a repo:

  git clone -–depth [depth] [remote-url]


Git has some strange behaviors with shallow clones (trying to manage volume using --depth). Shallow clones are great for CI builds, but not so great with working copies used actively by developers.

At this point in git the better tool is called "sparse clones" (using the --sparse keyword and some other associated tools). A lot of interesting engineering work has been put into making "sparse clones" very performant on "conical sections" ("sparse cones") of a repository at a time. (In the way of checking out a single sub-directory of a monorepo and just its history type of thing.)


OK but it still takes a long time with millions of source files.




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

Search: