Git log quickly and easily
Contents
These are some git log commands
I use everyday and I think they are helpful for you.
1 Log all
|
|
2 Filter the commits
|
|
3 Formatting output
You can also format the log messages by using the --pretty
option.
3.1 Predefing format
oneline
: Displays each commit on a single line.short
: Includes commit hash, author, date, and subject.medium
: Adds commit message and file changes.full
: Includes full commit information.format
: Allows custom formatting using placeholders (e.g., %H for commit hash, %an for author name, %s for subject).
|
|
3.2 Specifiers
%H
Commit hash%h
Abbreviated commit hash%T
Tree hash%t
Abbreviated tree hash%P
Parent hashes%p
Abbreviated parent hashes%an
Author name%ae
Author email%ad
Author date (format respects the –date=option)%ar
Author date, relative%cn
Committer name%ce
Committer email%cd
Committer date%cr
Committer date, relative%s
Subject
4 Other options
--graph
: Display a commit graph.--reverse
: Show commits in chronological order (oldest first).--no-merges
: Exclude merge commits.--oneline
: Show commit in one-line
And the last thing: You can combine multiple options