Loading
Current section: Commands 17 exercises
lesson

Inspecting Commit History with `git show`

git show is a command that allows you to inspect your commits. When used without any arguments, it will display the latest commit, including the full diff that the commit composes:


$ git show
commit 1e3b9b0061712908132409ssdf234 (HEAD -> main)
Author: Your Name <youremail@address.com

Loading lesson

Transcript

00:00 git show is the command that we use to inspect our commits. Without arguments, it will show the latest commit, including the full diff that the commit composes. Use Q to get out of this view. We can be explicit with git show using the commit SHA. Type git show the SHA ID.

00:19 Now, that's a pretty big ID, so the abbreviated versions work as well. Let's copy just the first six characters and run git show with that. You'll notice that this commit is at head on the main branch, so we can also use the head alias, git show head.