开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜