More information about git log command
As part of home task part 2, we were asked to read about git log command. So this blog post is dedicated to that. To get more info about git log command I had gone through Git pro book available at https://git-scm.com/book/en/v2/. From this book I had followed chapter https://git-scm.com/book/en/v2/Git-Basics-Viewing-the-Commit-History to study more about git log command.
When git log
is used without any argument, it displays all previous commits in reverse chronological order.
|
|
We can provide following arguments with git log
command to see different outputs formats.
- When
-n
is passed as an argument, where n is number it would show n number of commits.
|
|
- When
-p
or--patch
is passed as an argument, it shows difference or patch output between each commit
|
|
--stat
is used get abbreviated stats of each commits
--since=<date>
is used get logs from a particular time. One can pass months, years, days, hours etc to get log from that particular time.
--author=<pattern>
is used get logs from one or many authors.
|
|
Bonus Video: Thanks for reading the post check out this video on youtube explaining how git works internally.