3 ms·
How do they know which branch in my fork is mine vs upstream? Or in the case where I modify a forked branch?
by argd678 7y ago
How do they know which branch in my fork is mine vs upstream? Or in the case where I modify a forked branch?
- emmelaich 7y agoA branch is just a series of commits; if any one of the commits has a different hash (as this hack will do) then the commit and all following commits will have a different hash. Including the id of the branch (the HEAD).
- ajross 7y agoIt's sort of the reverse: they can't know, from a bare commit ID, what repo it "belongs" to without searching backward from every tag or branch in the repo. (Even that question is malformed: repos have histories and may have contained commits in the past that are no longer ancestors of existing branches or tags). So they just fake it: they look in their database to find any commit with that SHA and put it up. And that database happens (for obvious performance reasons) to be shared between a repo and its forks.