From 8d745c3a0f31918a8027e6b887038598481a1f1a Mon Sep 17 00:00:00 2001 From: Nia Calia-Bogan Date: Thu, 10 Sep 2020 21:09:44 -0400 Subject: [PATCH] git-log: update examples (#4293) --- pages/common/git-log.md | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/pages/common/git-log.md b/pages/common/git-log.md index 01769572c..e75d4ecc2 100644 --- a/pages/common/git-log.md +++ b/pages/common/git-log.md @@ -3,7 +3,7 @@ > Show a history of commits. > More information: . -- Show the sequence of commits starting from the current one, in reverse chronological order: +- Show the sequence of commits starting from the current one, in reverse chronological order of the git repository in the current working directory: `git log` @@ -11,17 +11,13 @@ `git log -p {{path/to/file_or_directory}}` -- Show only the first line of each commit message: - -`git log --oneline` - - Show an overview of which file(s) changed in each commit: `git log --stat` -- Show a graph of commits in the current branch: +- Show a graph of commits in the current branch using only the first line of each commit message: -`git log --graph` +`git log --oneline --graph` - Show a graph of all commits, tags and branches in the entire repo: @@ -30,3 +26,11 @@ - Show only commits whose messages include a given string (case-insensitively): `git log -i --grep {{search_string}}` + +- Show the last N commits from a certain author: + +`git log -n {{number}} --author={{author}}` + +- Show commits between two dates: + +`git log --before={{date}} --after={{date}}`