Jags _
Jags's Blog

Jags's Blog

Using Git Better - Part 2

Photo by Roman Synkevych ๐Ÿ‡บ๐Ÿ‡ฆ on Unsplash

Using Git Better - Part 2

Let's learn how to view git commit history better

Jags _'s photo
Jags _
ยท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 README.md
ย 
Share this