Practical Git: View commit history with git log

Trevor Miller
InstructorTrevor Miller

Share this video with your friends

Send Tweet
Published 5 years ago
Updated 3 years ago

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.

[00:00] 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.

[00:17] 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.