main branches locally
main branches locally
Posted Oct 25, 2025 2:01 UTC (Sat) by mathstuf (subscriber, #69389)In reply to: main branches locally by intgr
Parent article: Git considers SHA-256, Rust, LLMs, and more
That's fine; why is your local `main` tracking your fork's `main` if you're not keep it up-to-date?
> I might only use the fork for one pull request and never thereafter. Why even waste the disk space if there are no remaining feature branches?
Forks live in the same repository as the main one. They are segregated using git namespaces (see `gitnamespaces(7)`) so that each access uses a different ref namespace and cannot "see" each other. This is the root cause of that issue where one could push a commit to a fork and then rewrite the URL to be that of the main repository and it would render your content under upstream's URL. I believe there is now a banner when this is done to show that the content is not actually "in" the repository being viewed when the object/tree/commit is not actually reachable from the project's ref namespace.
There was slight reference to this in it being "20 bytes on disk" elsewhere in this thread, but even that might be wrong (besides ref files being 40 bytes due to their ASCII representation) because I believe forges now use `reftable` to store refs in a single file (sqlite db?) rather than a file-per-ref due to filesystem overhead with that mechanism. The vast majority of the cost of a fork is in the database presence it takes up, not the git repository itself.
The shared-repository-with-namespaced-refs is also why I think some namespace-hopping symref to just make a fork's `main` *be* upstream's `main` would be an ideal solution here.
