Mastering Git
Learn advanced git log

19 hours ago
If you’ve been working with Git, you may be aware of git log
command. Beyond its basic usage (i.e. plain git log
), the advanced use of this command might be quite powerful, making navigation of repositoryβs history seamless and informative. On this post, we are going to learn just a few useful ways to make use of git log
to bring your Git knowledge to the subsequent level.
This post assumes that the reader, you, are aware of the fundamental usage of Git. If you happen to need a refresher on Git basics, chances are you’ll want to examine out this text first. To make most of this post, I encourage you to practice using the commands as you read through the article. We learn faster once we are actively practicing latest knowledge than passively reading through it.
We’ll use considered one of my favourite GitHub repository: ABSphreak/readme-jokes: π Jokes in your GitHub READMEs to reveal the usage of commands. This awesome lightweight repository allowed me to incorporate random programming jokes in my GitHub profile. Letβs start by cloning the repo locally, go contained in the repository and run easy git log
to refresh how the command outputs appear like:
git clone https://github.com/ABSphreak/readme-jokes
cd readme-jokes
git log
The output quickly fills up our window and is bit wordy. Some details comparable to email address within the output will not be particularly useful more often than not. Letβs learn learn how to get more succinct log.
If you happen to simply want to examine previous commit messages without extra details, we will add --oneline
choice to get more concise output:
git log --oneline