4 ms·
Sequential commit numbers? How does that work with branching? Or other people's commits? eg. I commit #100, you commit #100, you pull my commit, now we have dup
by ekimekim 14y ago
Sequential commit numbers? How does that work with branching? Or other people's commits? eg. I commit #100, you commit #100, you pull my commit, now we have duplicate identifiers.
Git commit ids are a hash of the commit content. This has very nice properties in that:
- Ids are duplicate if and only if the commit is identical (the collision chance is so low it's not worth considering)
- It's content-addressable
And you can refer to it by any unique prefix, so it's not a pain to type out (and you should only rarely be typing out particular commits instead of branches or tags).
- lucian1900 14y agoMercurial has local sequential commit numbers. The hashes are of course what one must use when others are involved.