The git log command displays committed snapshots. It shows you list the project history.
git log command displays committed snapshots. It shows you list the project history.
git logoutput does not show you any information regarding the working directory or staging area. For this, you need to use git status.
git log output can be customized. Some of the most common configurations of git log are listed below.
To see only the commits of a certain author (abellsmythe) run
$ git log --author=abellsmythe
To see only which files have changed
$ git log --name-status
To see a very compressed log where each commit is one line run
$ git log --pretty=oneline
To see a limit list of
$ git log -n <n>
To see each commit to a single line. This is useful for a high-level overview of the project
$ git log --oneline
To see which files were modified and the relative number of lines that were added or deleted from each of them
$ git log --stat
To see the patch representing each commit. This shows the full diff of each commit that’s the most detailed view
$ git log -p
To search for commits with a commit message that matches a regular expression
$ git log --grep="<regex>"
could be also a simple string.
To see only commits that occur between
$ git log <since>..<until>
and arguments can be a commit Id, branch name, HEAD, or any revision reference.
To see commits that include one particular file.
$ git log <file>
To see an ASCII art tree of all the branches, decorated with the names of tags and branches
$ git log --graph --oneline --decorate --all
For more info run
git log --help
Note: keep in mind that several options can be combined into a single command