4 ms·
What's a DAG?
by wishinghand 7y ago
What's a DAG?
- kccqzy 7y agoDirected acyclic graph. Basically each git commit points to zero or more parent commits (usually one, zero for root commits, more than one for merge commits) and that forms a DAG.
- yaseer 7y agohttps://medium.com/girl-writes-code/git-is-a-directed-acyclic-graph-and-what-the-heck-does-that-mean-b6c8dec65059 https://medium.com/girl-writes-code/git-is-a-directed-acycli...
- rich-tea 7y agoUnfortunately this article, like almost all others, is still wrong because it looks like commits get mutated when you rebase and the old commits disappear. It is very important to understand that commits (in fact, all blobs) are immutable in git. You can only make new things. You can't modify old things. Git doesn't delete anything for a while either.
- masklinn 7y agoDirected Acyclic Graph. Graph = graph, a structure composed of a set of objects (nodes or vertices) with links between them (edges). Directed = the edges have an orientation / a direction. Acyclic = there's no cycle, you can't come back to a node (in a directed graph you have to follow edge direction). In Git, the commit objects are nodes, the "parent" link(s) is a directed edge, and because commit objects are immutable you can't create a commit which refers to one of its "descendants" and thus the graph is acyclic.