Explaining DAG: Directed Acyclic Graphs As Utilized In Git and 4 types of git nodes (root, head, branch, merge)
The concern is to illustrate the basics of the concept of DAG (directed acyclic graph) foundational for any distributed version control system (i.e. git)
1. graph
- graphs consist of nodes and edges lines joining those nodes together
- there are more common types of graphs such as trees (hierarchical graphs) or lists (with nodes having up to 2 pointers)
2. directed graph
- in a directed graph, edges have a defined direction
- this is because there is a parent-child relationship going on here
3. acyclic directed graph
- means that if you follow the direction, you can’t get to where you started
- it is not a tree in that a node can have > 1 parent (the merge node see the merge node)
- DAGs can get complex pretty quickly