Skip to content

Instantly share code, notes, and snippets.

@learnit-codeit
Created April 26, 2021 17:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save learnit-codeit/9a1cb0a1a6eeff0de3acb09f9881141b to your computer and use it in GitHub Desktop.
Save learnit-codeit/9a1cb0a1a6eeff0de3acb09f9881141b to your computer and use it in GitHub Desktop.
#Below command prints only two logs on the master branch
git log master -n=2
or
git log master --max-count=2
#Below command skips to print two logs on the master branch
git log master --skip=2
#Below command prints only the last two weeks logs of master branch
git log master --since="2 week ago"
#Below command prints the logs till yesterday
git log master --until="yesterday"
#Below command prints the logs of the author Anish
git log --author="Anish"
#Below command prints the log based on the commit message
git log --grep="First Commit"
#Below command prints the log based to the changed code content
git log -S"abcd.log"
or
-G"foo.*"
#Below command prints the log order by date
git log --date-order
#Below command prints the log in reverse order
git log --reverse
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment