git log -10
Would show 10 latest commits matching the revision spec (a missing spec means "all commits").
See manpage:
git help log
section Commit Limiting
-<number>, -n <number>, --max-count=<number>
Limit the number of commits to output.
Answer from kostix on Stack OverflowGit
git-scm.com › docs › git-log
Git - git-log Documentation
Various other options and paths parameters can be used to further limit the result. ... A special notation "<commit1>..<commit2>" can be used as a short-hand for "^<commit1> <commit2>". For example, either of the following may be used interchangeably: ... Another special notation is "<commit1>...<commit2>" which is useful for merges. The resulting set of commits is the symmetric difference between the two operands. The following two commands are equivalent: $ git log A B --not $(git merge-base --all A B) $ git log A...B
Poddarayush
poddarayush.com › posts › limit-git-log-output
Less is more - Limit the size of your Git log output | Poddar, Ayush
By default, git log returns all the commits. Generally, we require only a set of them. Learn how to limit the size of your Git log output.
logging - How to log first 10 commits in Git - Stack Overflow
Or, use git rev-list HEAD | tail -n 10 to get the 10 IDs to list, which you can then show in whatever format you like (not limited to the one-line method). 2012-04-27T07:09:04.223Z+00:00 ... tail seems to lose the nice coloring that I get in my git console. Passing a parameter like git log ... More on stackoverflow.com
Gitlab CI : git log limited to 10 commits
Gitlab CI : git log limited to 10 commits I’m trying to create release notes in a Gitlab CI job, but the git log command seems to be limited to ten commits. So when I push ore merge more than ten commits, I have this error : fatal: Invalid revision range. My command is git log ${CI_COMMI... More on forum.gitlab.com
How can I get git log to limit the number of lines per commit message? - Stack Overflow
I'm using git log to read through commit messages, but some of them are super-long, containing backtraces and other things that I don't want to see. I'd like to see maybe the first 10 lines of the ... More on stackoverflow.com
How do I limit the number of commits shows in git log per page but continue the pagination upon pressing spacebar? - Stack Overflow
I want to limit the commits shown in one go, right now it's maximum the screen can show. If I use git diff --oneline -20 it stops after 20, i want to continue after 20. More on stackoverflow.com
Atlassian
atlassian.com › git › tutorials › git-log
Advanced Git Log | Atlassian Git Tutorial
January 12, 2026 - You can limit git log’s output by including the -<n> option.
Git
git-scm.com › book › en › v2 › Git-Basics-Viewing-the-Commit-History
2.3 Git Basics - Viewing the Commit History
In addition to output-formatting options, git log takes a number of useful limiting options; that is, options that let you show only a subset of commits. You’ve seen one such option already — the -2 option, which displays only the last two commits. In fact, you can do -<n>, where n is any ...
Top answer 1 of 12
366
git log -10
Would show 10 latest commits matching the revision spec (a missing spec means "all commits").
See manpage:
git help log
section Commit Limiting
-<number>, -n <number>, --max-count=<number>
Limit the number of commits to output.
2 of 12
78
Simply log everything with one line format and tail the output:
git log --pretty=oneline | tail -n 10
Linux Kernel
kernel.org › pub › software › scm › git › docs › git-log.html
git-log(1) Manual Page
August 25, 2025 - Various other options and paths parameters can be used to further limit the result. ... A special notation "<commit1>..<commit2>" can be used as a short-hand for "^<commit1> <commit2>". For example, either of the following may be used interchangeably: ... Another special notation is "<commit1>...<commit2>" which is useful for merges. The resulting set of commits is the symmetric difference between the two operands. The following two commands are equivalent: $ git log A B --not $(git merge-base --all A B) $ git log A...B
MIT
web.mit.edu › git › www › git-log.html
git-log(1)
November 17, 2025 - Various other options and paths parameters can be used to further limit the result. ... A special notation "<commit1>..<commit2>" can be used as a short-hand for "^<commit1> <commit2>". For example, either of the following may be used interchangeably: ... Another special notation is "<commit1>...<commit2>" which is useful for merges. The resulting set of commits is the symmetric difference between the two operands. The following two commands are equivalent: $ git log A B --not $(git merge-base --all A B) $ git log A...B
Initial Commit
initialcommit.com › blog › git-log
git log | A Guide to Using the log Command in Git
May 29, 2022 - This command is rather verbose, so let’s combine it with our previously mentioned filter that limits our log to that last two commits: $ git log --stat -2 commit a7d29889d47dfc5e6c8f91974039f91231269d95 (HEAD -> master) Author: Initial Commit LLC <Example@domain.com> Date: Tue May 24 13:40:55 ...
Gitcheatsheet
gitcheatsheet.org › how-to › git-log-limit
Show the latest N commits | Git Cheat Sheet
git log -3 · Show the log containing commit history · Show the log, one line for each commit · Show the commits that affect a specific file or directory · Show a patch with changes introduced by each commit · Show the log as a graph · Filter the log entries by author name ·
Top answer 1 of 2
2
You would need to process each git log entry.
Make a bash script called git-logm (that works even on Windows) with
#!/bin/bash
for ((i=0; i<=$1; i++))
do
body=$(git log -1 --skip=$i --pretty=format:%B|head -4)
echo "HEAD~$i $body"
done
Then a git logm 5 would display 5 commits, each one with only the first 4 lines of their commit message.
2 of 2
0
I use this alias to get a quick view of all my commits, it is pretty convenient. Add it to your .bashrc or .zshrc file.
alias glo='git log --oneline --decorate'
Sample Output:
1417fb7 (HEAD -> master, origin/master) Updated .gitignore
5a22485 Add sample BG PDF docs
423131e Fixing the .gitignore file.
633d7de Added some examples
ab752e4 Initial commit
960d841 Create 'Hello World' example to output PDF.
Medium
medium.com › the-andela-way › exploring-the-git-log-command-9117b9ff3c2c
Exploring the Git log command. An In-depth look at the power of… | by John Kagga | The Andela Way | Medium
May 10, 2019 - 17aa4d468 (HEAD -> master, tag: ... DevTools logs and warnings (#11448) 221aa954f Refer people to "good first issue" 61d35ce1f Record sizes and fix bundle lint fd47129ce Remove support for passing badly typed elements to shallow renderer (#11442) c2b68dae6 Fix typo 6ad203630 Add a link to RCR explanation 73bb99626 Update changelog · We can limit the git log output ...
Unstop
unstop.com › home › blog › git log | a comprehensive guide including all options
Git Log | A Comprehensive Guide Including All Options
October 5, 2023 - As mentioned above, there are many ... the git log command and present a more detailed explanation in reference to the commit history. Some of these are as follows: --oneline: This option produces an overview of the respective Git project, and it presents a meaningful history in default mode. It displays each commit on a single line. -n: This option limits the number ...
Ubuntu Manpages
manpages.ubuntu.com › manpages › trusty › › man1 › git-log.1.html
Ubuntu Manpage: git-log - Show commit logs
See git-shortlog(1). --full-diff Without this flag, git log -p <path>... shows commits that touch the specified paths, and diffs about the same specified paths. With this, the full diff is shown for commits that touch the specified paths; this means that "<path>..." limits only commits, and ...
Linux Man Pages
linux.die.net › man › 1 › git-log
git-log(1): commit logs - Linux man page
Limit the commits output to ones with log message that matches the specified pattern (regular expression).
Linux Man Pages
man7.org › linux › man-pages › man1 › git-log.1.html
git-log(1) - Linux manual page
The remaining commits are what comes out in the command’s output. Various other options and paths parameters can be used to further limit the result. Thus, the following command: $ git log foo bar ^baz means "list all the commits which are reachable from foo or bar, but not from baz".