lab 12 Viewing Diverging Branches
Goals
- Learn how to view diverging branches in a repository.
View the Current Branches 01
We now have two diverging branches in the repository. Use the following log command to view the branches and how they diverge.
Execute:
git hist --all
Output:
$ git hist --all * 947edf2 2015-09-29 | Hello uses greet function (greet) [Jim Weirich] * 9f9f376 2015-09-29 | Added greeter function [Jim Weirich] | * 1523eec 2015-09-29 | Added README (HEAD -> master) [Jim Weirich] |/ * e801e10 2015-09-29 | Using argv [Jim Weirich] * 21c17bd 2015-09-29 | First commit [Jim Weirich]
Here is our first chance to see the --graph
option on git
hist
in action. Adding the --graph
option to git
log
causes it to draw the commit tree using simple ASCII characters. We can see both branches (greet and
master), and that the master branch is the current HEAD. The common ancestor to both branches is the
“Using argv” branch.
The --all
flag makes sure that we see all the branches. The default is to show only the current branch.