Git for Computer Scientists (2010)

# · 🔥 259 · 💬 101 · 2 years ago · eagain.net · thanato0s · 📷
Commit: A commit refers to a tree that represents the state of the files at the time of the commit. More than one parent means the commit is a merge, no parents means it is an initial commit, and interestingly there can be more than one initial commit; this usually means two separate projects merged. The body of the commit object is the commit message. Git commit adds a node to the DAG and moves the post-it note for current branch to this new node. Because we had new local commits, this wasn't a fast forward, but an actual new commit node was created in the DAG. Note how it has two parent commits. You can rebase your branch, where instead of merging, your commit is replaced by another commit with a different parent, and your branch is moved there. If you have extra post-its pointing to your old commit, they will remain pointing to it, and keep your old commit alive indefinitely.
Git for Computer Scientists (2010)



Send Feedback | WebAssembly Version (beta)