5. History is a chain of pointers to parents
A commit names its parent, the parent's name is part of the child's content, so one name covers a whole history; arrows always point backward; merges have two parents.

5. History is a chain of pointers to parents

A commit names its parent, the parent's name is part of the child's content, so one name covers a whole history; arrows always point backward; merges have two parents.

Every graph you will ever draw of Git has its arrows this way round, and the "name covers history" fact is why a commit id can be trusted.

Each commit names the commit it was made on top of. Its parent.

The arrows point backward. From child to parent. A commit does not know what comes after it.

The parent's name is part of the child's content. So the child's name covers its parent too. And the parent's parent. All the way down.

One name stands for a whole history. Same name, same history, byte for byte.

A merge has two parents. The chain becomes a graph. Still, every arrow points back.

Check yourself. Two commits have the same name. What can you say about their histories?

Do you like what you are reading? Subscribe to receive updates.

Unsubscribe anytime