This lesson is for PRO members.

Unlock this lesson NOW!
Already subscribed? sign in

Practical Git: View commit history with git log

0:40 Tools lesson by

It's often helpful to view the history of a code project; with Git, we can use the git log command to view all commits in our repo. This lets us view information about each commit like the commit id (for use in other git commands), author, author's email, and commit message. We can format the git log commit output to display more or less information or filter to specific commits using git log {arguments} which will be covered in the next few lessons of the course.

Get the Code Now
click to level up

egghead.io comment guidelines

Avatar
egghead.io

It's often helpful to view the history of a code project; with Git, we can use the git log command to view all commits in our repo. This lets us view information about each commit like the commit id (for use in other git commands), author, author's email, and commit message. We can format the git log commit output to display more or less information or filter to specific commits using git log {arguments} which will be covered in the next few lessons of the course.

In our command line, we're inside a directory called "Utility Functions," which is a git repository. Let's run the git log command. The git log command logs all of the commits in our repository with the most recent commits on top, and then older commits are you scroll down.

Taking a look at an individual commit, it consists of the commit ID, the author of the commit with the author email, the date the commit was made, as well as the commit message. When we run the git log command, we can pass an argument, which will let us either format the commits that are shown or filter down to a specific set of commits inside of our git log history.

HEY, QUICK QUESTION!
Joel's Head
Why are we asking?