Metadata
Every commit, merge, and so on, is accompanied by metadata. You can get at a lot of the metadata by using the log, but sometimes you just want to extract a few pieces of important metadata. For that you can use the show
command:
Figure 10.18: Using show to see metadata
In this example, we use show
to find the name and email of the author, along with the ID and the metadata telling us where the tip of main is. Let's break it down:
git
show
—theshow
command.-s
—silent (or quiet), which suppresses the difference output (try the command without it to see).HEAD
tells show which commit you are interested in.%an
is the author's name.%ae
is the author's email address.
We put this code into a string and assign it to the format flag.
Let's look at the log and see what else we can do with showing metadata:
Figure 10.19: Looking at the log
Let's zero in on the metadata...