-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
https://github.com/StoneyJackson/CollabDev/tree/master/Activities/Git-Graph-Structure-and-Branching
- Present commit nodes in the same order as
git log, most resent first. This will reduce the cognitive load when trying to match the commits in the log and the diagrams. - Point HEAD to the branch and not the commit, unless it has been checked out to a commit. When a branch is checked out, HEAD is attached to the branch. In this state, the branch that is checked out is the active branch, and when a commit is made, the branch is advanced, and HEAD is implicitly advance by virtue of being attached to the branch. If a commit is ever checked out, HEAD then points to that commit, and we are in a "detached HEAD" state. This refers to HEAD not being attached to a branch. When a commit is made, HEAD is advanced, but no branch is advanced.
- Remove the asterisk? This is a notation used by
git branchto show which branch is active. The active branch is the branch that HEAD points to. So this is redundant information in the diagrams. However, if the point of the diagram is to teach about asterisk, then it should stay. - I would prefer to use
git branch <name>and notgit branch <name> <commit>for creating a commit. I feel the former is more common, and the latter is not necessary. For example to create a new branch for v1.0: I prefergit checkout v1.0 ; git branch bug-fix ; git checkout bug-fixovergit branch bug-fix v1.0 ; git checkout bug-fix. Even though the former is longer and leads to a detached head state the number of commands needed to learn are fewer overall (I consider commands with different number of parameters a separate command). - In diagrams, make a visual distinction between a branch and a tag.
Metadata
Metadata
Assignees
Labels
No labels