←back to thread

199 points elza_1111 | 10 comments | | HN request time: 0.855s | source | bottom
1. SillyUsername ◴[] No.44452402[source]
Git never forgets, this isn't really a shocking revelation.
replies(3): >>44452453 #>>44452484 #>>44452485 #
2. eviks ◴[] No.44452453[source]
What specific property of git mandates a website to not clean up those dangling commits?
replies(1): >>44452893 #
3. tux3 ◴[] No.44452484[source]
Git does forget, it has a gc mechanism specifically for forgetting.

GitHub can't use the native git gc, and apparently doesn't have their own fork-aware and weird-cross-repo-merge-aware gc, so they might just not have built a way to track which commits are dangling.

But that's not obvious at all.

replies(2): >>44452600 #>>44454335 #
4. tossandthrow ◴[] No.44452485[source]
Git is not point in time backups. It is versioning.

You are free to organize your version history as you fit, and you can certainly rewrite history.

The only issue you might have is signed commits from collaborators, that you can not resign.

replies(2): >>44452668 #>>44452672 #
5. lelandfe ◴[] No.44452600[source]
How to make git an elephant: https://donatstudios.com/yagni-git-gc
6. lloeki ◴[] No.44452668[source]
> and you can certainly rewrite history.

But you can't coerce everyone in the world to remove all traces of the alternate history that was a thing before being rewritten.

So while you can make git forget something in your local repo, you can't make git forget across the decentralised set of repos, which is part of git's core design.

So in that sense, yes, git never forgets, by design.

7. ◴[] No.44452672[source]
8. orthoxerox ◴[] No.44452893[source]
Git has no de jure hierarchy of repositories. We de facto treat the GH repo as the primary one (and call it "origin"), but mechanically it's a peer repo. Even though it lets other repos push it around a bit and obeys commands like "change the branch to point to another commit", there are no commands to force it to delete the data.
replies(1): >>44452937 #
9. eviks ◴[] No.44452937{3}[source]
> Even though it lets other repos push it around

So there is hierarchy

> there are no commands to force it to delete the data.

That's just the current state, the question was how git prevents "de facto" deletion on a server? How is it anti-git to ask the server to execute git garbage collection commands, for example?

10. SillyUsername ◴[] No.44454335[source]
Ah right, so forking the codebase, then deleting the original repo forces git to forget all copies. Gotcha thanks for the enlightenment.