frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Show HN: Downloading a folder from a repo using rust

https://github.com/zikani03/git-down
9•sonderotis•4d ago

Comments

luismedel•4h ago
So,

  $ git-down -d bootstrap-dist https://github.com/twbs/bootstrap.git:master dist
is *way* better than

  $ git clone --depth 1 https://github.com/twbs/boostrap.git
  $ cd bootstrap
  $ mv ./dist ~/stuff/boostrap-latest 
because: "C'mon, you don't have the time to be doing all that."

And then we wonder how the fuck we end with malware in our systems.

panki27•4h ago
All that's missing is `curl ... | sudo bash` as install instruction in the README
panki27•4h ago

   $ git clone --no-checkout $URL/repo.git
   $ cd repo/
   $ git sparse-checkout init
   $ git sparse-checkout set subdirectory_i_want
   $ git checkout main
cakoose•4h ago
Now I'm curious -- is that here a way to do this that avoids downloading any more than strictly necessary?

The command above downloads the whole repo history. You could do a depth=1 to skip the history, but it still downloads the he latest version of the entire repo tree.

vient•3h ago
git-archive downloads only strictly necessary files but is not universally supported

https://git-scm.com/docs/git-archive

craftkiller•2h ago
You could do a blobless or treeless clone https://github.blog/open-source/git/get-up-to-speed-with-par...

Combined with --depth=1 and the --no-checkout / --sparse-checkout flow that the GP already described.

I just tested on the emacs repo, left column is disk usage of just the `.git` folder inside:

  Shallow clones (depth=1):
  124K: Treeless clone depth=1 with no-checkout
  308K: Blobless clone depth=1 with no-checkout
  12M: Treeless clone depth=1 sparse checkout of "doc" folder
  12M: Blobless clone depth=1 sparse checkout of "doc" folder
  53M: Treeless clone depth=1 non-sparse full checkout
  53M: Blobless clone depth=1 non-sparse full checkout
  53M: Regular clone with depth=1

  Non-shallow clones:
  54M: Treeless clone with no-checkout
  124M: Blobless clone with no-checkout
  65M: Treeless clone sparse checkout of "doc" folder
  135M: Blobless clone sparse checkout of "doc" folder
  107M: Treeless clone with non-sparse full checkout
  177M: Blobless clone with non-sparse full checkout
  653M: Full regular git clone with no flags
Great tech talk covering some of the newer lesser-known git features: https://www.youtube.com/watch?v=aolI_Rz0ZqY
archargelod•3h ago
The rust app just calls a few git commands too[1]

Could've been a shell script[2]

[1] https://github.com/zikani03/git-down/blob/cb2763020edc81e464...

[2] https://textbin.net/ja17q8vga4

vient•4h ago
Same can be done using git and tar

    mkdir -p <out_dir> && git archive --remote=<remote> --format=tar.gz <branch> <files...> | tar -xzC <out_dir>
Strangely, github does not support this, so tested with bitbucket.
koakuma-chan•4h ago
I have a similar problem with hugging face. I do git clone and it doesn't download models. I know it's supposed to use LFS, but I don't know how to make it work, I tried everything. I had to install their disgusting Python CLI to download a model.
0fflineuser•2h ago
Don't you just need to install git-lfs https://git-lfs.com/ and then run `git lfs pull` ?
koakuma-chan•2h ago
Oh I guess I didn't run `git lfs pull` lol thanks
pornel•4h ago
There's hardly any Rust in there. It's shelling out to the git command. This could have been a couple lines of bash.

Actually doing this in Rust with lower-level libraries like gix would have been interesting.

tsylba•3h ago
You guys using convoluted git commands when a single line of subversion works:

svn checkout https://github.com/tensorflow/tensorflow/trunk/tensorflow/ex...

zenmac•2h ago
Link is broken
pharrington•1h ago
Since this is a "Show HN," did you mean to post using your https://news.ycombinator.com/user?id=zikani_03 account?

OrioleDB Patent: now freely available to the Postgres community

https://supabase.com/blog/orioledb-patent-free
189•tosh•3h ago•66 comments

I replaced Animal Crossing's dialogue with a live LLM by hacking GameCube memory

https://joshfonseca.com/blogs/animal-crossing-llm
658•vuciv•12h ago•138 comments

Kerberoasting

https://blog.cryptographyengineering.com/2025/09/10/kerberoasting/
59•feross•3h ago•19 comments

Pontevedra, Spain declares its entire urban area a "reduced traffic zone"

https://www.greeneuropeanjournal.eu/made-for-people-not-cars-reclaiming-european-cities/
405•robtherobber•5h ago•462 comments

iPhone Air

https://www.apple.com/newsroom/2025/09/introducing-iphone-air-a-powerful-new-iphone-with-a-breakt...
828•excerionsforte•20h ago•1689 comments

Guy running a Google rival from his laundry room

https://www.fastcompany.com/91396271/searcha-page-seekninja-diy-search-engines
82•coloneltcb•1h ago•59 comments

Show HN: CrabCamera – Cross-platform camera plugin for Tauri desktop apps

https://crates.io/crates/crabcamera
20•MKuykendall•3d ago•2 comments

E-paper display reaches the realm of LCD screens

https://spectrum.ieee.org/e-paper-display-modos
523•rbanffy•21h ago•170 comments

Rendering flame fractals with a compute shader (2023)

https://wrighter.xyz/blog/2023_08_17_flame_fractals_in_comp_shader
32•ibobev•2d ago•6 comments

NASA finds Titan's lakes may be creating vesicles with primitive cell walls

https://www.sciencedaily.com/releases/2025/08/250831112449.htm
207•Gaishan•15h ago•53 comments

Knowledge and memory

https://www.robinsloan.com/lab/knowledge-and-memory/
51•zdw•3d ago•24 comments

Infracost (YC W21) Is Hiring First Product Manager to Shift FinOps Left

https://www.ycombinator.com/companies/infracost/jobs/ukwJ299-senior-product-manager
1•akh•3h ago

Claude now has access to a server-side container environment

https://www.anthropic.com/news/create-files
603•meetpateltech•1d ago•316 comments

US High school students' scores fall in reading and math

https://apnews.com/article/naep-reading-math-scores-12th-grade-c18d6e3fbc125f12948cc70cb85a520a
444•bikenaga•1d ago•800 comments

All clickwheel iPod games have now been preserved for posterity

https://arstechnica.com/gaming/2025/09/all-54-lost-clickwheel-ipod-games-have-now-been-preserved-...
174•CharlesW•1d ago•47 comments

Some thoughts on personal Git hosting

https://shkspr.mobi/blog/2025/09/some-thoughts-on-personal-git-hosting/
50•ColinWright•3d ago•42 comments

We all dodged a bullet

https://xeiaso.net/notes/2025/we-dodged-a-bullet/
774•WhyNotHugo•23h ago•430 comments

R-Zero: Self-Evolving Reasoning LLM from Zero Data

https://arxiv.org/abs/2508.05004
79•lawrenceyan•13h ago•32 comments

PKM apps need to get better at resurfacing information

https://ankursethi.com/blog/pkm-apps-need-to-get-better-at-resurfacing-information/
27•GeneralMaximus•3d ago•17 comments

Children and young people's reading in 2025

https://literacytrust.org.uk/research-services/research-reports/children-and-young-peoples-readin...
54•GeoAtreides•8h ago•47 comments

YouTube is a mysterious monopoly

https://anderegg.ca/2025/09/08/youtube-is-a-mysterious-monopoly
316•geerlingguy•1d ago•410 comments

Tarsnap Is Cozy

https://til.andrew-quinn.me/posts/tarsnap-is-cozy/
37•hiAndrewQuinn•2h ago•24 comments

Axial twist theory

https://en.wikipedia.org/wiki/Axial_twist_theory
161•lordnacho•3d ago•39 comments

Hypervisor in 1k Lines

https://1000hv.seiya.me/en
109•lioeters•15h ago•11 comments

Memory Integrity Enforcement

https://security.apple.com/blog/memory-integrity-enforcement/
448•circuit•20h ago•208 comments

Tomorrow's emoji today: Unicode 17.0

https://jenniferdaniel.substack.com/p/tomorrows-emoji-today-unicode-170
187•ChrisArchitect•21h ago•300 comments

Show HN: Bottlefire – Build single-executable microVMs from Docker images

https://bottlefire.dev/
139•losfair•3d ago•21 comments

Semantic Line Breaks

https://sembr.org
40•Bogdanp•3d ago•33 comments

Building a DOOM-like multiplayer shooter in pure SQL

https://cedardb.com/blog/doomql/
227•lvogel•23h ago•35 comments

Show HN: Ark v0.5.0 – A Minimal, High-Performance Entity Component System for Go

https://github.com/mlange-42/ark
7•mlange-42•37m ago•0 comments