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
10•sonderotis•5mo ago

Comments

luismedel•5mo 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•5mo ago
All that's missing is `curl ... | sudo bash` as install instruction in the README
panki27•5mo 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•5mo 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•5mo ago
git-archive downloads only strictly necessary files but is not universally supported

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

craftkiller•5mo 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•5mo 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•5mo 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•5mo 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•5mo ago
Don't you just need to install git-lfs https://git-lfs.com/ and then run `git lfs pull` ?
koakuma-chan•5mo ago
Oh I guess I didn't run `git lfs pull` lol thanks
pornel•5mo 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.

zikani_03•5mo ago
I've found that using Git libraries directly is usually slow and less ergonomic. I've got another tool (written in Go) here: https://github.com/zikani03/git-monorepo which uses a Git library and is a bit slow.

But I'm willing to take up that challenge and test out gix, I've regained my interest in Rust so the timing is good :)

tsylba•5mo 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•5mo ago
Link is broken
craftkiller•5mo ago
Yes, subversion wins for this ONE specific use case. It's such a shame subversion is miserable to use in every other use case.
pharrington•5mo ago
Since this is a "Show HN," did you mean to post using your https://news.ycombinator.com/user?id=zikani_03 account?
zikani_03•5mo ago
I'm not the one who posted, thanks to the OP for sharing though :)

DoNotNotify is now Open Source

https://donotnotify.com/opensource.html
247•awaaz•6h ago•45 comments

Why E cores make Apple silicon fast

https://eclecticlight.co/2026/02/08/last-week-on-my-mac-why-e-cores-make-apple-silicon-fast/
71•ingve•2h ago•50 comments

Show HN: Fine-tuned Qwen2.5-7B on 100 films for probabilistic story graphs

https://cinegraphs.ai/
31•graphpilled•2h ago•6 comments

Reverse Engineering Raiders of the Lost Ark for the Atari 2600

https://github.com/joshuanwalker/Raiders2600
30•pacod•4h ago•1 comments

Matchlock – Secures AI agent workloads with a Linux-based sandbox

https://github.com/jingkaihe/matchlock
60•jingkai_he•5h ago•19 comments

Dave Farber has died

https://lists.nanog.org/archives/list/nanog@lists.nanog.org/thread/TSNPJVFH4DKLINIKSMRIIVNHDG5XKJCM/
58•vitplister•2h ago•9 comments

Curating a Show on My Ineffable Mother, Ursula K. Le Guin

https://hyperallergic.com/curating-a-show-on-my-ineffable-mother-ursula-k-le-guin/
25•bryanrasmussen•3h ago•13 comments

Beyond agentic coding

https://haskellforall.com/2026/02/beyond-agentic-coding
171•RebelPotato•12h ago•52 comments

Show HN: LocalGPT – A local-first AI assistant in Rust with persistent memory

https://github.com/localgpt-app/localgpt
268•yi_wang•12h ago•131 comments

Show HN: It took 4 years to sell my startup. I wrote a book about it

https://derekyan.com/ma-book/
11•zhyan7109•3d ago•3 comments

Slop Terrifies Me

https://ezhik.jp/ai-slop-terrifies-me/
82•Ezhik•3h ago•66 comments

Rabbit Ear "Origami": programmable origami in the browser

https://rabbitear.org/book/origami.html
36•molszanski•3d ago•3 comments

The Legacy of Daniel Kahneman: A Personal View (2025)

https://ejpe.org/journal/article/view/1075/753
24•cainxinth•3d ago•1 comments

A11yJSON: A standard to describe the accessibility of the physical world

https://sozialhelden.github.io/a11yjson/
19•robin_reala•5d ago•2 comments

We mourn our craft

https://nolanlawson.com/2026/02/07/we-mourn-our-craft/
431•ColinWright•19h ago•571 comments

SectorC: A C Compiler in 512 bytes (2023)

https://xorvoid.com/sectorc.html
330•valyala•20h ago•66 comments

LLMs as the new high level language

https://federicopereiro.com/llm-high/
154•swah•5d ago•290 comments

I write games in C (yes, C) (2016)

https://jonathanwhiting.com/writing/blog/games_in_c/
207•valyala•20h ago•227 comments

OpenClaw Is Changing My Life

https://reorx.com/blog/openclaw-is-changing-my-life/
29•novoreorx•7h ago•53 comments

The Architecture of Open Source Applications (Volume 1) Berkeley DB

https://aosabook.org/en/v1/bdb.html
56•grep_it•5d ago•8 comments

Software factories and the agentic moment

https://factory.strongdm.ai/
252•mellosouls•22h ago•405 comments

Arcan Explained – A browser for different webs

https://arcan-fe.com/2026/01/26/arcan-explained-a-browser-for-different-webs/
8•walterbell•5h ago•0 comments

Speed up responses with fast mode

https://code.claude.com/docs/en/fast-mode
203•surprisetalk•19h ago•217 comments

Hoot: Scheme on WebAssembly

https://www.spritely.institute/hoot/
202•AlexeyBrin•1d ago•43 comments

Modern and Antique Technologies Reveal a Dynamic Cosmos

https://www.quantamagazine.org/how-modern-and-antique-technologies-reveal-a-dynamic-cosmos-20260202/
12•sohkamyung•5d ago•0 comments

Stories from 25 Years of Software Development

https://susam.net/twenty-five-years-of-computing.html
222•vinhnx•23h ago•26 comments

Vocal Guide – belt sing without killing yourself

https://jesperordrup.github.io/vocal-guide/
387•jesperordrup•1d ago•125 comments

uLauncher

https://github.com/jrpie/launcher
44•dtj1123•5d ago•18 comments

Roger Ebert Reviews "The Shawshank Redemption" (1999)

https://www.rogerebert.com/reviews/great-movie-the-shawshank-redemption-1994
40•monero-xmr•8h ago•46 comments

Brookhaven Lab's RHIC concludes 25-year run with final collisions

https://www.hpcwire.com/off-the-wire/brookhaven-labs-rhic-concludes-25-year-run-with-final-collis...
88•gnufx•18h ago•66 comments