Home Artificial Intelligence Level up your Git knowledge with these 10 useful tricks to browse git history πŸ”§ 0. Setup πŸ“ 1. Display succinct log for every commit in a single line

Level up your Git knowledge with these 10 useful tricks to browse git history πŸ”§ 0. Setup πŸ“ 1. Display succinct log for every commit in a single line

0
Level up your Git knowledge with these 10 useful tricks to browse git history
πŸ”§ 0. Setup
πŸ“ 1. Display succinct log for every commit in a single line

Mastering Git

Learn advanced git log

Towards Data Science

10 min read

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.

Photo by Chris Lawton on Unsplash

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
Image by creator | Keyboard shortcuts used: Use down arrow to see more log output, press q to exit log output.

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

LEAVE A REPLY

Please enter your comment!
Please enter your name here