this post was submitted on 10 Dec 2025
5 points (85.7% liked)
Linux
10605 readers
453 users here now
A community for everything relating to the GNU/Linux operating system (except the memes!)
Also, check out:
Original icon base courtesy of lewing@isc.tamu.edu and The GIMP
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Great answer on the whole, but worth noting that both Git’s standard CLI client and most hosted git services do run periodic GC to prune dangling commits.
I second the suggestion to take periodic snapshots of your mirror. Because the majority of file contents will not be changing over time, you can make these snapshots very disk-space efficient by taking binary diffs of the tar’d repo using rdiff or the like.
True, I can do that with btrfs snapshots
Pruning clears cached blobs and unlinked objects. It 100% will not clear history unless you're forcing a specific depth to be achieved, which, again, is not something that people who want a functional repo would do.
Dangling commits are unlinked objects, and happen pretty frequently if you’re using hard resets instead of explicit
git reverts.Not arguing that it’s good practice but it’s very common.