The single `git log` command to display the last 3 commits, each on one line, showing only the commit hash and subject, and excluding any merge commits is: `git log -n 3 --no-merges --pretty=format:"%h %s"`.
`git log` is a core Git command used to view the recorded history of a repository. It displays a list of commits, ordered by default from the most recent to the oldest.
`-n 3` is an option that limits the output of `git log` to a specific number of commits. In this case, `-n 3` tells Git to display only the three most recent commits in the history.
`--no-merges` is an option that filters the commit history to exclude merge ....
Log in to view the answer