Git directed acyclic graph - children know their parents but not the other way around
Git is implemented as a directed acyclic graph. Children know their parents but not the other way round. This makes sense because i can reach every commit only through a branch or a tag ( generally speaking through a reference). That's how i traverse the tree. What other reasons had the developers of Git to make "the c开发者_运维百科hildren know their parents but not the other way around"?/ What are the key benefits of this?
The main benefit is that a revision once committed has never to be changed again. If you update it to include children, you have to rewrite it. That messes up the hash codes used for identity and integrity.
精彩评论