$ git log [-n COUNT]
list the commit history of the current branch.
limits the number of commits to the specified number.
$ git log [--after="YYYY-MM-DD"] [--before="YYYY-MM-DD"]
Commit history filtered by date.
Relative information such as
1 week agoor
yesterdayis also permitted.
$ git log --author="NAME"
filters the commit history by authors.
You can also search for several authors at the same time, for example
$ git log --author="VEIT|VSC"
$ git log --grep = "TERM"
filters the commit history for regular expressions in the commit message.
$ git log -S"FOO"
filters commits according to certain lines in the source code.
$ git log -G"BA*"
filters commits based on regular expressions in the source code.
$ git log -- PATH/TO/FOO.PY
filters the commit history for specific files.
$ git log MAIN ..FEATURE
filters for different commits in different branches, in our case between the branches
However, this is not the same as
$ git log FEATURE..MAIN. Let’s take the following example.
A - B main \ C - D feature
$ git log MAIN..FEATURE
shows changes in
FEATUREthat are not contained in
MAIN, that are the commits
$ git log FEATURE..MAIN
shows changes in
MAINthat are not contained in
FEATURE, that is the commit
$ git log MAIN...FEATURE
shows the changes on both sides, the commits
$ git log --oneline --graph --decorate
Show the history diagram with references, one commit per line.
$ git log REF..
List commits that exist in the current branch and are not merged into
refcan be the name of a branch or a tag.
$ git log ..REF
List commits that exist in
refand are not merged with the current branch.
$ git reflog
List operations (for example
commit) that have been performed in the local repository.