Using Git Better - Part 2

Let's learn how to view git commit history better

May 24, 2022Β·

1 min read

Play this article

Let's learn how to view commit history better

A better way to view commit history

git log --pretty=format:"%h - %an, %ar : %s" -6

Time limiting the logs you see

git log --pretty=format:"%h - %an, %p %ar : %s" --since=2.weeks
git log --pretty="%h - %s" --since="2022-01-01" --before="2022-06-01"

git restore is an alternative to git reset

Unstaging a Staged File with git restore from Git v2.23 onwards**

git restore --staged